/**
 * Guest Dashboard Styles
 * Styles specific to the public-facing guest dashboard
 */

/* Back to Events button - for event details page header center */
.btn-back-to-events {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #4d6171;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-back-to-events:hover {
    background: #3d4e5c;
    text-decoration: none;
    color: white;
}

.btn-back-to-events svg {
    flex-shrink: 0;
}

body.dark-mode .btn-back-to-events {
    background: #5a7186;
}

body.dark-mode .btn-back-to-events:hover {
    background: #4a6073;
}

/* Dark Back Button - Option C style */
.btn-back-dark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #001d34;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.btn-back-dark:hover {
    background: #003366;
    color: white;
    text-decoration: none;
}

.btn-back-dark svg {
    flex-shrink: 0;
}

body.dark-mode .btn-back-dark {
    background: #4d6171;
}

body.dark-mode .btn-back-dark:hover {
    background: #5a7186;
}

/* Event Details Content Area */
.event-details-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .event-details-content {
        padding: 20px;
    }
}

/* Sign In button in header - matches Export All style */
.btn-sign-in {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #6c7a89;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-sign-in:hover {
    background: #5a6878;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 122, 137, 0.3);
    color: white;
    text-decoration: none;
}

.btn-sign-in svg {
    flex-shrink: 0;
}

/* Sign Out button */
.btn-sign-out {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.btn-sign-out:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

body.dark-mode .btn-sign-out {
    color: #aaa;
    border-color: #555;
}

body.dark-mode .btn-sign-out:hover {
    background: #3a3a3a;
    border-color: #666;
    color: #fff;
}

/* View Toggle Button - Manager/Attendee switch */
.view-toggle {
    display: none; /* Hidden by default, shown only for managers */
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.view-toggle.visible {
    display: flex;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.view-toggle-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.view-toggle-btn.active {
    background: #4d6171;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.view-toggle-btn.active:hover {
    background: #3d4e5c;
}

.view-toggle-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Dark mode adjustments */
body.dark-mode .view-toggle {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .view-toggle-btn {
    color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .view-toggle-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .view-toggle-btn.active {
    background: #5a7186;
    color: white;
}

body.dark-mode .view-toggle-btn.active:hover {
    background: #4a6073;
}

/* Legacy Manager Dashboard button - kept for backwards compatibility */
.btn-manager-dashboard {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #4d6171;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    margin-right: 12px;
}

.btn-manager-dashboard:hover {
    background: #3d4e5c;
    text-decoration: none;
    color: white;
}

.btn-manager-dashboard svg {
    flex-shrink: 0;
}

body.dark-mode .btn-manager-dashboard {
    background: #5a7186;
}

body.dark-mode .btn-manager-dashboard:hover {
    background: #4a6073;
}

/* ========================================
   User Info Dropdown Styles
   ======================================== */

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-chevron {
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.user-info.open .dropdown-chevron {
    transform: rotate(180deg);
}

.profile-info-inline {
    text-align: right;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.profile-email {
    font-size: 12px;
    color: #666;
}

body.dark-mode .profile-name {
    color: #e6e7e8;
}

body.dark-mode .profile-email {
    color: #999;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #4d6171, #001d34);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.profile-initials {
    text-transform: uppercase;
}

/* Profile Dropdown Menu */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-info.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.dark-mode .profile-dropdown {
    background: #2c2c2c;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
}

body.dark-mode .dropdown-header {
    background: #333;
}

.profile-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4d6171, #001d34);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}

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

.dropdown-user-name {
    font-size: 15px;
    font-weight: 600;
    color: #001d34;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .dropdown-user-name {
    color: #e6e7e8;
}

.dropdown-user-email {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .dropdown-user-email {
    color: #999;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0;
}

body.dark-mode .dropdown-divider {
    background: #444;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    text-decoration: none;
}

.dropdown-item:hover {
    background: #f0f0f0;
    text-decoration: none;
    color: #333;
}

body.dark-mode .dropdown-item {
    color: #e6e7e8;
}

body.dark-mode .dropdown-item:hover {
    background: #3a3a3a;
    color: #e6e7e8;
}

.dropdown-item svg {
    flex-shrink: 0;
    color: #666;
}

body.dark-mode .dropdown-item svg {
    color: #999;
}

.dropdown-item-text {
    flex: 1;
}

.dropdown-item-danger {
    color: #dc3545;
}

.dropdown-item-danger:hover {
    background: #fff5f5;
}

body.dark-mode .dropdown-item-danger {
    color: #ff6b6b;
}

body.dark-mode .dropdown-item-danger:hover {
    background: rgba(255, 107, 107, 0.1);
}

.dropdown-item-danger svg {
    color: #dc3545;
}

body.dark-mode .dropdown-item-danger svg {
    color: #ff6b6b;
}

/* Theme toggle switch in dropdown */
.theme-toggle-switch {
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 11px;
    position: relative;
    transition: background 0.2s ease;
}

body.dark-mode .theme-toggle-switch {
    background: #4d6171;
}

.theme-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark-mode .theme-toggle-slider {
    transform: translateX(18px);
}

.theme-icon-light {
    display: block;
}

.theme-icon-dark {
    display: none;
}

body.dark-mode .theme-icon-light {
    display: none;
}

body.dark-mode .theme-icon-dark {
    display: block;
}

/* Availability text styles */
.spots-low {
    color: #e67e22 !important;
    font-weight: 600;
}

.spots-none {
    color: #e74c3c !important;
    font-weight: 600;
}

/* Loading state */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error state */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.error-state p {
    margin-bottom: 16px;
}

.btn-retry {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-retry:hover {
    background: #0077b3;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state svg {
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0;
}

/* Calendar styles are inherited from manager-dashboard.css */
/* Additional guest-specific overrides if needed */

.calendar-more-indicator {
    font-size: 10px;
    color: #666;
    padding: 2px 0;
    position: absolute;
}

/* Hide actions column for guest view (no export buttons) */
.guest-dashboard .header-actions,
.guest-dashboard .event-actions {
    display: none;
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    margin-top: 8px;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.btn-pagination {
    padding: 8px 16px;
    background: #6c7a89;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pagination:hover:not(:disabled) {
    background: #5a6878;
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.dark-mode .pagination-info {
    color: #999;
}

body.dark-mode .btn-pagination {
    background: #5a7186;
}

body.dark-mode .btn-pagination:hover:not(:disabled) {
    background: #4a6073;
}

/* ========================================
   Guest View Event List - No Status Column
   ======================================== */

/* Override the event-item grid for guest view */
body.guest-view .event-item,
body.guest-view .event-item.event-row-published,
body.guest-view .event-item.event-row-draft {
    grid-template-columns: 2fr 1.2fr 1.2fr 1.5fr 1fr;
    padding-left: 20px;
    background: #ffffff;
}

body.guest-view .event-item:hover {
    background: #f8f9fa;
}

body.dark-mode.guest-view .event-item,
body.dark-mode.guest-view .event-item.event-row-published,
body.dark-mode.guest-view .event-item.event-row-draft {
    background: #3a3a3a;
}

body.dark-mode.guest-view .event-item:hover {
    background: #404040;
}

/* Add events list header for guest view grid */
body.guest-view .events-list-header {
    grid-template-columns: 2fr 1.2fr 1.2fr 1.5fr 1fr;
}

/* Responsive adjustments for guest view */
@media (max-width: 1100px) {
    body.guest-view .event-item,
    body.guest-view .events-list-header {
        grid-template-columns: 2fr 1fr 1fr 1.2fr 1fr;
    }
}

@media (max-width: 900px) {
    body.guest-view .event-item,
    body.guest-view .events-list-header {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    body.guest-view .event-item .event-location {
        display: none;
    }
}

@media (max-width: 768px) {
    body.guest-view .event-item,
    body.guest-view .events-list-header {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 16px;
    }

    body.guest-view .event-item .event-info {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    body.guest-view .event-item .event-location {
        display: block;
    }

    body.guest-view .event-item .event-datetime {
        flex-direction: row;
        gap: 8px;
    }

    body.guest-view .event-item .event-datetime .event-date::after {
        content: ",";
    }

    /* View toggle - smaller on medium screens */
    .view-toggle-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* View toggle - icons only on small screens */
    .view-toggle {
        padding: 3px;
    }

    .view-toggle-btn {
        padding: 6px 8px;
        gap: 0;
    }

    .view-toggle-label {
        display: none;
    }
}

/* Dark mode adjustments */
body.dark-mode .btn-sign-in {
    background: #5a7186;
}

body.dark-mode .btn-sign-in:hover {
    background: #4a6073;
    box-shadow: 0 4px 12px rgba(90, 113, 134, 0.4);
}

body.dark-mode .calendar-day.today {
    background: rgba(0, 162, 225, 0.2);
}

/* ========================================
   Custom Field Group Fieldsets (Guest Form)
   ======================================== */

.custom-field-group-fieldset {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 3px 20px 20px;
    margin: 16px 0 0 0;
}

/* Ungrouped fields between groups need consistent spacing */
#custom-fields-container > .form-group,
#editCustomFields > .form-group {
    margin: 16px 0 0 0;
}

body.dark-mode .custom-field-group-fieldset {
    border-color: #3d4a55;
}

.custom-field-group-fieldset legend {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding: 0 8px;
    margin-left: -4px;
}

body.dark-mode .custom-field-group-fieldset legend {
    color: #e6e7e8;
}

.field-group-description {
    font-size: 13px;
    color: #666;
    margin: 0 0 16px 0;
    font-style: italic;
}

body.dark-mode .field-group-description {
    color: #888;
}
