:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-blur: blur(10px);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-white: #ffffff;
    --text-dim: #cbd5e1;
    --bg-dark: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-white);
    overflow-x: hidden;
}

.glass-card {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.navbar {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-left: auto;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: rgba(99, 102, 241, 0.2);
    color: white;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    outline: none;
    transition: border-color 0.3s ease;
}

select.form-control option {
    background-color: #1e293b;
    color: white;
}

.share-btn-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-whatsapp {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.btn-whatsapp:hover {
    background: rgba(34, 197, 94, 0.4);
}

.btn-facebook {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.btn-facebook:hover {
    background: rgba(59, 130, 246, 0.4);
}

.btn-linkedin {
    background: rgba(14, 118, 168, 0.2);
    border-color: rgba(14, 118, 168, 0.4);
    color: #38bdf8;
}

.btn-linkedin:hover {
    background: rgba(14, 118, 168, 0.4);
}

.copy-success {
    color: #4ade80;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: none;
}

/* AI Recommendation Styles */
.recommendation-container {
    margin-top: 2rem;
}

.recommendation-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.recommendation-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
    border-color: rgba(99, 102, 241, 0.3);
}

.recommendation-content {
    flex: 1;
}

.recommendation-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
    display: block;
}

.recommendation-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.recommendation-reason {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.btn-facebook {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.btn-facebook:hover {
    background: rgba(59, 130, 246, 0.4);
}

.btn-linkedin {
    background: rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.4);
    color: #38bdf8;
}

.btn-linkedin:hover {
    background: rgba(14, 165, 233, 0.4);
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.media-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.media-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-owned {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-wishlist {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-using {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-completed {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.admin-link {
    color: #fbbf24 !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-toggle {
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    padding: 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.nav-toggle:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.8);
    outline-offset: 2px;
}

.nav-toggle-icon {
    display: grid;
    gap: 5px;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text-white);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.navbar.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbar.nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.navbar.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.page-title {
    font-size: 2.5rem;
}

.page-header,
.section-header,
.split-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 0.9rem;
}

.landing-footer {
    padding: 4rem;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
}

.auth-shell {
    margin: 4rem auto;
}

.form-shell {
    max-width: 600px;
    margin: 2rem auto;
}

.profile-shell {
    max-width: 800px;
    margin: 0 auto;
}

.profile-layout {
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.admin-main-grid {
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.two-col-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.full-span {
    grid-column: 1 / -1;
}

.action-row {
    display: flex;
    gap: 1rem;
}

.share-url-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filters-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-search {
    flex: 1 1 240px;
    min-width: 200px;
}

.filter-select {
    flex: 1 1 160px;
    max-width: 180px;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    display: block;
    margin-bottom: 0.4rem;
}

.media-list-header {
    margin-bottom: 2rem;
}

.media-list-filters-card {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.collection-item-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
    gap: 0.75rem;
}

.collection-item-actions form {
    margin: 0;
}

@media (max-width: 900px) {
    .container {
        margin: 1.5rem auto;
    }

    .navbar {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .navbar .brand {
        font-size: 1.25rem;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-links {
        order: 3;
        margin-left: 0;
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding-top: 0.6rem;
    }

    .navbar.nav-open .nav-links {
        display: flex;
    }

    .nav-links a,
    .nav-links .btn {
        width: 100%;
        text-align: center;
    }

    .page-title {
        font-size: 2.1rem;
    }

    .hero {
        height: auto;
        min-height: 70vh;
        padding: 3rem 0 2rem;
    }

    .hero h1 {
        font-size: clamp(2.2rem, 9vw, 3.2rem);
    }

    .hero p {
        font-size: 1.05rem;
        margin-bottom: 2rem;
    }

    .profile-layout,
    .admin-main-grid,
    .two-col-form {
        grid-template-columns: 1fr;
    }

    .split-row {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .container {
        margin: 1rem auto;
        padding: 0 0.85rem;
    }

    .glass-card {
        padding: 1.15rem;
    }

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

    .page-header,
    .section-header,
    .split-row {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .btn,
    .section-header .btn,
    .split-row .btn {
        width: 100%;
        text-align: center;
    }

    .filters-form {
        flex-direction: column;
        align-items: stretch;
    }

    .media-list-header {
        margin-bottom: 1.25rem;
        gap: 0.75rem;
    }

    .media-list-filters-card {
        padding: 1rem;
        margin-bottom: 1.25rem;
    }

    .media-list-filters-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .media-list-filters-form .filter-search,
    .media-list-filters-form .filter-select {
        margin: 0;
        padding: 0;
        flex: 0 1 auto;
    }

    .media-list-filters-form .filter-label {
        margin-bottom: 0.25rem;
        line-height: 1.2;
    }

    .media-list-filters-form .form-control {
        margin: 0;
    }

    .filter-search,
    .filter-select {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .media-list-filters-form .filter-actions {
        margin-top: 0.1rem;
        gap: 0.5rem;
    }

    .filter-actions .btn {
        width: 100%;
        text-align: center;
    }

    .action-row,
    .share-url-row,
    .share-btn-group {
        flex-direction: column;
    }

    .action-row .btn,
    .share-url-row .btn,
    .share-btn-group .btn {
        width: 100%;
        text-align: center;
    }

    .collection-item-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .collection-item-actions .btn,
    .collection-item-actions form {
        width: 100%;
    }

    .collection-item-actions form button {
        width: 100%;
        text-align: center;
        padding: 0.4rem 0;
    }

    .recommendation-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .recommendation-item .btn {
        width: 100%;
    }

    .hero-cta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-cta .btn {
        width: 100%;
        text-align: center;
    }

    .hero::before,
    .hero::after {
        display: none;
    }

    .auth-shell {
        margin: 1.5rem auto;
    }

    .site-footer {
        margin-top: 2rem;
        padding: 1.5rem 1rem;
    }

    .landing-footer {
        padding: 2.25rem 1rem;
    }
}
