:root {
    --glass-bg: rgba(0, 0, 0, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.6);
    --primary-color: #ffffff;
    --primary-hover: #f3f4f6;
    --accent-color: #ffffff;
    --text-color: #ffffff;
    --text-muted: #94a3b8;
    --bg-gradient: radial-gradient(circle at top left, #1a1a1a 0%, #000000 100%);
    --card-bg: rgba(255, 255, 255, 0.03);
    --sidebar-width: 280px;
    --mobile-nav-height: 60px;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glass Utilities */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

/* Auth Page Specifics */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 20px;
    background: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&q=80&w=2672') center/cover no-repeat;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 0;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 48px;
}

.auth-title {
    font-size: 2.75rem;
    font-weight: 900;
    margin-bottom: 32px;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #64748b 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

/* Dashboard Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .sidebar {
        border-radius: 0;
        padding: 20px;
        position: relative;
        height: auto;
    }

    .main-content {
        padding: 24px;
        overflow: visible;
    }
}

.sidebar {
    padding: 32px;
    display: flex;
    flex-direction: column;
    border-radius: 0 32px 32px 0;
    border-left: none;
    z-index: 10;
}

.sidebar-brand {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 48px;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.nav-link {
    padding: 14px 20px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.main-content {
    padding: 48px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .header-content .btn {
        width: 100%;
    }
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    appearance: none;
    -webkit-appearance: none;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    background-color: #1a1a1a;
}

select.form-control option {
    background-color: #1a1a1a;
    color: white;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
}

.form-helper {
    margin-top: 8px;
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.visibility-toggle {
    display: inline-flex;
    width: 100%;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.visibility-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.visibility-toggle label {
    flex: 1;
    margin: 0;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.visibility-toggle label:not(:last-of-type) {
    border-right: 1px solid var(--glass-border);
}

.visibility-toggle input[type="radio"]:checked + label {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 24px;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-search {
    flex: 2;
    min-width: 200px;
}

.filter-location {
    flex: 1;
    min-width: 140px;
}

.filter-date {
    flex: 2.5;
    min-width: 300px;
}

.filter-status {
    flex: 0.8;
    min-width: 140px;
}

.filter-row {
    display: flex;
    gap: 16px;
    width: 100%;
}

@media (max-width: 1024px) {
    .filter-group {
        flex: 1 1 calc(50% - 16px);
    }
}

@media (max-width: 640px) {
    .filter-group {
        flex: 1 1 100%;
    }
}

/* Event Cards */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.invitations-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

.invitations-menu {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invite-view-link {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.invite-view-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.invite-view-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.28);
}

.invitations-content {
    min-width: 0;
}

.event-card {
    padding: 32px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.02);
}

.event-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.04);
}

.event-tag {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    margin-bottom: 16px;
    display: inline-block;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.event-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
}

.event-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Status Tracking Buttons */
.status-actions {
    display: flex;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-status {
    width: auto;
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.btn-status:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-status.active {
    background: white;
    color: black;
    font-weight: 700;
}

/* Template Selector */
.template-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.template-btn {
    flex: 0 0 auto;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.template-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.template-btn span {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.template-btn label {
    font-size: 0.75rem;
    cursor: pointer;
}

/* AI Builder Section */
.ai-builder-section {
    background: rgba(139, 92, 246, 0.05);
    border: 1px dashed rgba(139, 92, 246, 0.3);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.ai-builder-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

@media (max-width: 640px) {
    .ai-builder-input {
        flex-direction: column;
    }

    .ai-builder-input .btn {
        width: 100%;
    }
}

.ai-limit-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.ai-limit-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.ai-builder-input input {
    flex: 1;
}

.status-badge {
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.event-badges {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.visibility-badge {
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.visibility-public {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.visibility-private {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-attending {
    background: #10b981;
    color: white;
}

.status-maybe {
    background: #f59e0b;
    color: white;
}

.status-declined {
    background: #ef4444;
    color: white;
}

.status-invited {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
    overflow-y: auto;
    backdrop-filter: blur(12px);
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 540px;
    padding: 40px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    margin: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@media (max-width: 640px) {
    .modal {
        padding: 16px;
        align-items: flex-start;
    }

    .modal-content {
        padding: 24px;
        max-height: calc(100dvh - 32px);
    }
}

.share-link-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-link-row .form-control {
    flex: 1;
}

.social-share-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.share-btn {
    width: 100%;
    min-width: 0;
    text-decoration: none;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    color: #000;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    min-width: 80px;
}

.btn-action-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.btn-invite {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-invite:hover {
    color: #000;
}

.btn-edit {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}

.btn-edit:hover {
    background: rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.8);
    color: white;
}

.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    filter: grayscale(1);
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Utilities */
.hidden {
    display: none;
}

.auth-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* User Profile Section in Sidebar */
.user-profile-section {
    margin-top: auto;
}

.user-info-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
}

.user-label {
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.role-badge {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 700;
}

.logout-link {
    color: #ef4444;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-link:hover {
    color: #f87171;
}

/* AI Magic Button */
.ai-magic-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border-radius: 10px;
}

.ai-magic-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.ai-loading {
    animation: pulse 1.5s infinite;
}

@media (max-width: 640px) {
    .invitations-layout {
        grid-template-columns: 1fr;
    }

    .share-link-row {
        flex-direction: column;
    }

    .share-link-row .btn {
        width: 100% !important;
    }

    .social-share-group {
        grid-template-columns: 1fr;
    }
}
