/* Gearstash Base CSS — Layout + Structure using CSS Custom Properties */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Courier New', Courier, monospace;
    background: var(--bg-primary);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Profile Card */
.profile-card {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 36px;
    margin: 24px 0 36px;
    box-shadow: var(--card-shadow);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: var(--accent-glow-sm);
    flex-shrink: 0;
}

.profile-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-primary-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    flex-shrink: 0;
}

.profile-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.profile-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82em;
    transition: background 0.2s, color 0.2s;
}

.profile-links a:hover {
    background: rgba(var(--accent-rgb), 0.18);
    color: var(--accent);
}

.profile-link-icon {
    font-size: 1.1em;
}

.profile-wishlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 8px;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.82em;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}

.profile-wishlist-btn:hover {
    background: rgba(var(--accent-rgb), 0.2);
    border-color: var(--accent);
}

.profile-settings-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    text-decoration: none;
    font-size: 1.3em;
    transition: background 0.2s, transform 0.2s;
    align-self: flex-start;
}

.profile-settings-btn:hover {
    background: rgba(var(--accent-rgb), 0.2);
    transform: rotate(45deg);
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 1.8em;
    color: var(--text-primary);
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    margin: 0 0 4px;
    line-height: 1.2;
}

.profile-bio {
    color: var(--text-secondary);
    margin: 0 0 10px;
    font-size: 0.95em;
    line-height: 1.5;
}

.profile-stats-box {
    flex-shrink: 0;
    display: flex;
    gap: 1px;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
    align-self: center;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-card);
}

.profile-stat-number {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.profile-stat-label {
    font-size: 0.72em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Section Titles */
h1.page-title {
    font-size: 2.5em;
    color: var(--accent);
    text-shadow: var(--accent-glow);
    text-align: center;
    margin: 20px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.section-title {
    font-size: 1.3em;
    color: var(--accent);
    margin: 32px 0 16px;
    text-align: center;
}

/* Latest Gear */
.latest-gear {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 4px 0 16px;
}

.latest-gear-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.latest-gear-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.latest-gear-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: var(--accent-glow-sm);
}

.latest-gear-name {
    display: block;
    font-size: 0.85em;
    color: var(--text-primary);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.latest-gear-mfr {
    display: block;
    font-size: 0.75em;
    color: var(--text-muted);
}

/* Wishlist */
.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.wishlist-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    transition: transform 0.2s;
}

.wishlist-card:hover {
    transform: translateY(-2px);
}

.wishlist-img, .wishlist-img-placeholder {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.wishlist-img-placeholder {
    background: rgba(var(--accent-rgb), 0.05);
    border: 1px dashed rgba(var(--accent-rgb), 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.wishlist-img-placeholder::after {
    content: "Kein Bild";
    color: rgba(var(--accent-rgb), 0.15);
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transform: rotate(-25deg);
}

.wishlist-grid-lg {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.wishlist-grid-lg .wishlist-card {
    padding: 16px 18px;
}

.wishlist-grid-lg .wishlist-img,
.wishlist-grid-lg .wishlist-img-placeholder {
    height: 240px;
    margin-bottom: 12px;
}

.wishlist-grid-lg .wishlist-name {
    font-size: 1.05em;
}

.wishlist-grid-lg .wishlist-note {
    font-size: 0.85em;
    margin-top: 6px;
}

.wishlist-name {
    font-size: 0.95em;
    color: var(--text-primary);
    font-weight: 600;
}

.wishlist-name a {
    color: var(--accent);
    text-decoration: none;
}

.wishlist-name a:hover {
    text-decoration: underline;
}

.wishlist-price {
    color: var(--accent);
    font-size: 0.9em;
    font-weight: 700;
    margin-top: 4px;
}

.wishlist-note {
    color: var(--text-muted);
    font-size: 0.8em;
    margin-top: 4px;
}

/* Search Bar */
.search-bar {
    max-width: 500px;
    margin: 20px auto 30px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: var(--accent-glow-sm);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--card-shadow);
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
}

.category-cover {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: var(--accent-glow-sm);
}

.category-card h3 {
    font-size: 1.5em;
    color: var(--accent);
    text-shadow: var(--accent-glow);
    margin-bottom: 8px;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.95em;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 10px;
    font-size: 0.95em;
    text-align: center;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover { opacity: 0.7; }

.breadcrumb-sep {
    color: var(--text-muted);
    margin: 0 8px;
}

/* Subcategory Titles */
.subcategory-title {
    font-size: 1.3em;
    color: var(--accent-secondary);
    text-shadow: var(--accent-secondary-glow);
    margin: 32px 0 12px;
    text-align: center;
}

/* Items Table */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.items-table th,
.items-table td {
    border: 1px solid var(--border);
    padding: 10px;
    text-align: center;
}

.items-table th {
    background: var(--bg-table-header);
    font-size: 1.1em;
    color: var(--accent);
}

.items-table td {
    background: var(--bg-card);
}

.item-thumb {
    width: 120px;
    height: auto;
    border-radius: 5px;
    box-shadow: var(--accent-glow-sm);
    cursor: pointer;
    transition: transform 0.2s;
}

.item-thumb:hover {
    transform: scale(1.05);
}

/* Popover */
#popover {
    position: fixed;
    max-width: 400px;
    width: 90%;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 12px;
    box-shadow: 0 0 30px var(--accent-glow-color);
    padding: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: none;
}

#popover img { width: 100%; border-radius: 8px; margin-bottom: 15px; }
#popover h2 { margin-top: 0; color: var(--accent); }
#popover .close-btn {
    position: absolute;
    top: 8px;
    right: 14px;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-primary);
    transition: color 0.2s;
}
#popover .close-btn:hover { color: var(--accent-secondary); }

#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    display: none;
}

/* Search Results */
.search-results { text-align: left; margin-bottom: 40px; }
.search-cat-header { font-size: 1.3em; color: var(--accent); margin: 28px 0 8px; }
.search-cat-header a { color: inherit; text-decoration: none; }
.search-cat-header a:hover { opacity: 0.7; }
.search-sub-header { font-size: 1em; color: var(--accent-secondary); margin: 16px 0 10px; }
.search-items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 12px; }

.search-item-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}
.search-item-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.search-item-card img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.search-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-item-info strong { font-size: 0.95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-mfr { font-size: 0.8em; color: var(--text-muted); }
.search-item-card mark { background: rgba(var(--accent-rgb), 0.25); color: var(--accent); border-radius: 2px; padding: 0 2px; }

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85em;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.back-link {
    display: inline-block;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.9em;
    transition: all 0.2s;
}

.back-link:hover { border-color: var(--accent); color: var(--accent); }

.powered-by { display: block; margin-top: 8px; }

/* Responsive */
@media (max-width: 768px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats-box {
        width: 100%;
        justify-content: center;
    }

    h1.page-title {
        font-size: 1.8em;
        letter-spacing: 2px;
    }

    .profile-card {
        padding: 24px 20px;
    }

    .profile-name {
        font-size: 1.5em;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .items-table { min-width: 0; }
    .items-table thead { display: none; }
    .items-table tbody tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 16px;
        text-align: left;
    }
    .items-table tbody td {
        display: block;
        border: none;
        padding: 6px 0;
        background: transparent;
        text-align: left;
    }
    .items-table tbody td:before {
        content: attr(data-label);
        display: block;
        font-size: 0.8em;
        color: var(--accent);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }
    .items-table tbody td:first-child { text-align: center; }
    .items-table tbody td:first-child:before { display: none; }
    .item-thumb { width: 100%; max-width: 200px; }

    .search-items-grid { grid-template-columns: 1fr; }
    .latest-gear-item { min-width: 120px; }
}

@media (max-width: 480px) {
    h1.page-title { font-size: 1.5em; }
    .container { padding: 12px; }
    .profile-card { padding: 20px; }
}
