* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #75c1c4;
    --primary-light: #8fd0d3;
    --primary-dark: #5fa9ad;
    --secondary-color: #75c1c4;
    --accent-color: #75c1c4;
    --accent-dark: #5fa9ad;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --text-color: #e0e0e0;
    --text-light: #a0a0a0;
    --bg-color: #030303;
    --card-bg: #0a0a0a;
    --border-color: #222222;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.6);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    & > nav { flex-shrink: 0; }

    & > main {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    & > .footer { flex-shrink: 0; }
}

/* ── Lucide icons ── */
i[data-lucide] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

svg.lucide {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;

    .empty-state & {
        width: 4rem;
        height: 4rem;
    }

    .stat &,
    .theme-meta span & {
        width: 1rem;
        height: 1rem;
    }

    .theme-card-actions &,
    .rating-btn &,
    .search-bar & {
        width: 1.125rem;
        height: 1.125rem;
    }

    .theme-rating-actions .rating-btn & {
        width: 0.875rem;
        height: 0.875rem;
    }

    .download-stat-btn & {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* ── Navbar ── */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.5rem;

    &:hover { color: var(--primary-color); }
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link,
button#logout-btn {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;

    &:hover {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

    &.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }
}

.nav-user-dropdown { position: relative; }

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
    font-weight: 500;

    &:hover {
        color: var(--primary-color);

        & .nav-avatar { border-color: white; }
    }
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.nav-username { font-size: 0.95rem; }

.nav-user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    overflow: hidden;

    &[style*="display: flex"] .dropdown-icon { transform: rotate(180deg); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);

    & i {
        width: 1rem;
        height: 1rem;
    }

    &:hover {
        background: var(--bg-color);
        color: var(--primary-color);
    }

    &.active {
        background: var(--bg-color);
        color: var(--primary-color);
        border-bottom: 2px solid var(--primary-color);
    }

    &.dropdown-logout {
        color: var(--danger-color);
        border-top: 1px solid var(--border-color);

        &:hover { color: #75c1c4; }
    }
}

.dropdown-icon {
    margin-left: auto;
    transition: transform 0.2s ease;
}

/* ── Main content ── */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.page-header {
    text-align: left;
    margin-bottom: 3rem;

    & h1 {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    & .subtitle {
        color: var(--text-light);
        font-size: 1.1rem;
    }

    & .btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }
}

/* ── Toolbar ── */
.toolbar {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    position: relative;
    max-width: 500px;

    & input {
        width: 100%;
        padding: 0.75rem 1rem 0.75rem 3rem;
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        font-size: 1rem;
        transition: var(--transition);
        background: var(--bg-color);
        color: var(--text-color);

        &::placeholder { color: var(--text-light); }

        &:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(211, 153, 229, 0.15);
        }
    }
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.sort-controls,
.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;

    & label {
        color: var(--text-light);
        font-weight: 500;
    }

    & select {
        padding: 0.5rem 1rem;
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        font-size: 1rem;
        cursor: pointer;
        background: var(--card-bg);
        transition: var(--transition);
        color: var(--text-color);

        &:focus {
            outline: none;
            border-color: var(--primary-color);
        }
    }
}

/* ── Theme grid & cards ── */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    flex: 1;
}

.theme-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    max-height: 300px;

    &:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-5px);
    }
}

.theme-card-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 80px;
    position: relative;
    overflow: hidden;

    &::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
        opacity: 0.15;
        z-index: 0;
    }

    & > * {
        position: relative;
        z-index: 1;
    }
}

.theme-card-header-left {
    display: flex;
    margin-right: auto;
}

.theme-platform-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;

    & img {
        width: 16px;
        height: 16px;
        border-radius: 3px;
    }
}

.theme-card-badges {
    display: flex;
    gap: 0.4rem;
}

.theme-card-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    color: white;
    font-weight: 500;

    & svg {
        width: 12px;
        height: 12px;
    }
}

.theme-accent-preview {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-card-colors {
    display: flex;
    gap: 0.4rem;
}

.color-dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
}

.theme-card-actions {
    display: flex;
    gap: 0.5rem;

    & a,
    & button {
        padding: 0.5rem;
        border-radius: 50%;
        background: var(--card-bg);
        backdrop-filter: blur(4px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        cursor: pointer;
        transition: var(--transition);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

        &:hover {
            background: var(--primary-color);
            color: white;
        }
    }
}

.theme-card-body {
    padding: 1.5rem;
    flex: 1;
}

.theme-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-name-link {
    text-decoration: none;
    color: inherit;

    &:hover .theme-name { color: var(--primary-color); }
}

.theme-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    &.truncate {
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.theme-card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;

    & .author-name { font-size: 1.2rem; }
}

/* ── Author / mod icons ── */
.theme-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;

    &:hover .author-name { color: var(--primary-color); }
}

.author-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;

    .theme-meta & {
        width: 2.5rem;
        height: 2.5rem;
    }
}

.author-name {
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.theme-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-light);
}

.mod-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);

    .theme-meta & {
        width: 1.5rem;
        height: 1.5rem;
        border-radius: 4px;
    }
}

.mod-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    text-decoration: none;

    &:hover {
        transform: scale(1.1);

        & .mod-icon { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); }
    }
}

.mod-icon-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

/* ── Buttons ── */
.btn {
    padding: 0.5rem 0;
    border-radius: 0;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
    background: transparent;
    color: var(--text-color);

    &:hover { border-bottom-color: var(--accent-color); }

    &.primary {
        color: var(--primary-color);

        &:hover {
            color: var(--primary-light);
            border-color: var(--primary-color);
        }
    }

    &.secondary {
        color: var(--text-light);

        &:hover { color: var(--accent-color); }
    }

    &.danger {
        color: var(--danger-color);

        &:hover {
            color: #75c1c4;
            border-width: 3px;
        }
    }

    &.icon { padding: 0.5rem; }

    &.full-width,
    &.full-width { width: 100%; justify-content: center; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Empty state ── */
.empty-state {
    grid-column: 1 / -1;
    text-align: left;
    padding: 4rem 2rem;
    color: var(--text-light);

    & i {
        font-size: 4rem;
        margin-bottom: 1rem;
        color: var(--primary-color);
    }

    & p {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }
}

/* ── Auth ── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    max-width: 520px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;

    & h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
        color: var(--text-color);
    }

    & p {
        color: var(--text-light);
        font-size: 1.1rem;
    }
}

.auth-logo {
    width: 4rem;
    height: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.auth-providers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-providers-header {
    text-align: center;
    margin-bottom: 0.5rem;

    & p {
        font-size: 0.9rem;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 1px;
        font-weight: 500;
    }
}

.auth-options {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1rem;
    border-radius: 1.5rem;
    text-decoration: none;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;

    &:hover {
        border-color: var(--primary-color);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);

        & .auth-btn-arrow {
            transform: translateX(4px);
            color: var(--primary-color);
        }
    }
}

.auth-btn-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: white;

    & img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

.auth-btn-content {
    flex: 1;
    min-width: 0;

    & strong {
        display: block;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-color);
    }

    & span {
        font-size: 0.9rem;
        color: var(--text-light);
    }
}

.auth-btn-arrow {
    flex-shrink: 0;
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;

    &::before,
    &::after {
        content: '';
        position: absolute;
        top: 50%;
        width: 45%;
        height: 1px;
        background: var(--border-color);
    }

    &::before { left: 0; }
    &::after  { right: 0; }

    & span {
        background: var(--card-bg);
        padding: 0 1rem;
        color: var(--text-light);
    }
}

.rotur-form {
    & .input-group { margin-bottom: 1rem; }

    & label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    & input {
        width: 100%;
        padding: 0.75rem;
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        font-size: 1rem;

        &:focus {
            outline: none;
            border-color: var(--primary-color);
        }
    }
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);

    & a:hover { text-decoration: underline; }
}

.auth-footer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;

    &:hover {
        color: var(--accent-color);
        text-decoration: underline;
    }
}

.auth-footer-divider {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ── Theme detail ── */
.theme-detail-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.theme-detail-main {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.theme-detail-banner {
    height: 200px;
    width: 100%;
}

.theme-detail-content { padding: 2.5rem; }

.theme-preview-colors {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.preview-color-dot {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

.theme-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

.theme-title-group { flex: 1; }

.theme-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.theme-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;

    & .mod-info {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: var(--bg-color);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.875rem;
        font-weight: 500;
        color: inherit;
        text-decoration: none;
        transition: opacity 0.2s;

        &:hover { opacity: 0.8; }
    }

    & .created-at {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--text-light);
        font-size: 0.875rem;
    }
}

.theme-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;

    &.vertical {
        flex-direction: column;

        & .btn {
            width: 100%;
            justify-content: center;
            padding: 0.75rem;
        }
    }
}

.theme-rating-actions {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-color);
    padding: 0.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;

    & .rating-btn {
        padding: 0.5rem 1rem;
        border: none;
        background: var(--card-bg);
        border-radius: 16px;
        cursor: pointer;
        transition: var(--transition);
        display: flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.85rem;
        color: var(--text-light);
        font-weight: 500;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

        &:hover:not(:disabled) {
            background: var(--primary-color);
            color: white;
            transform: translateY(-1px);
        }

        &.active { background: var(--primary-color); color: white; }

        &.dislike.active { background: var(--danger-color); }

        &:disabled,
        &.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        &.disabled:hover {
            background: var(--card-bg);
            color: var(--text-light);
            transform: none;
        }
    }
}

.download-stat-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: var(--card-bg);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-description,
.theme-specs,
.theme-wallpaper {
    margin-bottom: 2.5rem;

    & h2 {
        margin-bottom: 1.25rem;
        color: var(--text-color);
        font-size: 1.5rem;
    }
}

.theme-description > p {
    color: var(--text-light);
    font-size: 1.2rem;
    line-height: 1.8;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.spec-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spec-label {
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.spec-value {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-color);
}

/* ── Author sidebar ── */
.author-sidebar {
    position: sticky;
    top: 2rem;
    align-self: start;
}

.author-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    text-align: center;
}

.author-avatar-wrapper { margin-bottom: 1rem; }

.author-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.view-profile-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;

    &:hover { text-decoration: underline; }
}

.author-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-item { text-align: center; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 1000;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.actions-card {
    margin-top: 1rem;

    & h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
        color: var(--text-color);
    }
}

/* ── Settings ── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.setting-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    & label {
        color: var(--text-light);
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    & .setting-value {
        font-weight: 600;
        font-size: 1.1rem;
    }
}

/* ── Wallpaper ── */
.wallpaper-preview {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;

    & img {
        width: 100%;
        height: auto;
        display: block;
    }
}

.wallpaper-info {
    color: var(--text-light);
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

/* ── Forms ── */
.form-section {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;

    & h2 {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--border-color);
    }
}

.form-group {
    margin-bottom: 1.5rem;

    & label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    & input,
    & textarea,
    & select {
        width: 100%;
        padding: 0.75rem;
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        font-size: 1rem;
        font-family: inherit;
        background: var(--card-bg);
        color: var(--text-color);

        &:focus {
            outline: none;
            border-color: var(--primary-color);
        }
    }

    & textarea {
        min-height: 120px;
        resize: vertical;
    }
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.accent-colors {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.accent-color-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--border-radius);

    & input[type="color"] {
        width: 3rem;
        height: 3rem;
        border: none;
        padding: 0;
        cursor: pointer;
        border-radius: 50%;
    }

    & input[type="range"] { flex: 1; }

    & button {
        padding: 0.5rem;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--danger-color);
    }
}

.form-actions { display: flex; gap: 1rem; }

/* ── Profile ── */
.profile-header {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 3rem;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.profile-avatar {
    flex-shrink: 0;

    & img {
        width: 8rem;
        height: 8rem;
        border-radius: 50%;
        border: 4px solid var(--primary-color);
    }
}

.profile-info { flex: 1; }

.profile-name {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.profile-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-light);

    & span {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

.profile-themes & h2 { margin-bottom: 2rem; }

/* ── Settings page ── */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.settings-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;

    & i { color: var(--primary-color); }
}

.settings-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    animation: slideIn 0.5s ease-out;

    &:hover {
        box-shadow: var(--shadow-lg);
        border-color: var(--primary-color);
        transform: translateY(-2px);
    }

    &:last-child { margin-bottom: 0; }

    &.danger-zone {
        background: linear-gradient(135deg, rgba(231, 76, 60, 0.05), rgba(231, 76, 60, 0.02));
        border-color: rgba(231, 76, 60, 0.3);

        & .section-icon-wrapper {
            background: var(--danger-color);
            box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
        }

        & .section-title { color: var(--danger-color); }

        &:hover {
            border-color: var(--danger-color);
            box-shadow: 0 8px 24px rgba(231, 76, 60, 0.2);
        }
    }
}

.section-icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    & i {
        width: 24px;
        height: 24px;
        color: white;
    }
}

.section-content { flex: 1; }

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    align-items: center;
    gap: 0.5rem;

    & i {
        width: 20px;
        height: 20px;
        color: var(--primary-color);
    }
}

.section-description {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.danger-zone-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 2px dashed var(--border-color);
    margin-top: 1rem;

    & .btn {
        flex: 1;
        min-width: 200px;
        justify-content: center;
        padding: 0.75rem 1.5rem;
        font-weight: 600;
        font-size: 1rem;
        border: 2px solid rgba(231, 76, 60, 0.5);
        border-bottom: 2px solid var(--danger-color);
        border-radius: 0;
        transition: var(--transition);

        &:hover {
            border-color: var(--danger-color);
            border-bottom-width: 3px;
        }
    }
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);

    &.edit-theme-modal {
        max-width: 500px;

        & .form-actions { justify-content: flex-end; }
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);

    & h2 {
        margin: 0;
        font-size: 1.5rem;
    }
}

.close-modal {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);

    &:hover { color: var(--text-color); }
}

.modal-body { padding: 1.5rem; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ── Export dropdown ── */
.export-dropdown {
    position: relative;
    display: inline-flex;
}

.export-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    overflow: hidden;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;

    &.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.export-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
    font-size: 0.9rem;

    &:last-child { border-bottom: none; }

    &:hover {
        background: var(--bg-color);
        color: var(--primary-color);
    }
}

/* ── Footer ── */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 3rem 0 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.footer-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);

    &:hover { color: var(--primary-color); }

    &.active {
        color: var(--primary-color);
        font-weight: 500;
    }
}

/* ── About ── */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.about-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);

    & h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
        color: var(--text-color);
    }

    & p {
        color: var(--text-light);
        font-size: 1.1rem;
        line-height: 1.8;
        margin-bottom: 1.5rem;
    }
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;

    & li {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: var(--text-light);
        font-size: 1.1rem;

        & i {
            color: var(--primary-color);
            flex-shrink: 0;
        }
    }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .theme-detail-layout { grid-template-columns: 1fr 300px; }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;

        & .nav-link span { display: none; }
    }

    .toolbar { flex-direction: column; }

    .theme-detail-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .theme-detail-content { padding: 1.5rem; }

    .theme-header-section { flex-direction: column; }

    .theme-title { font-size: 1.8rem; }

    .theme-actions {
        width: 100%;
        flex-direction: row;

        & .btn {
            flex: 1;
            justify-content: center;
        }
    }

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

    .author-sidebar { position: static; }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .settings-container { padding: 1rem; }

    .settings-section {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;

        &:hover { transform: none; }
    }

    .danger-zone-actions {
        flex-direction: column;

        & .btn { width: 100%; }
    }

    .footer {
        padding: 2rem 0 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .footer-section { gap: 0.75rem; }

    .footer-title { font-size: 1.25rem; }

    .footer-description {
        font-size: 0.875rem;
        grid-column: 1 / -1;
    }
}