/* =====================================================
   ROTORUA PISTOL CLUB - MEMBERS STYLESHEET
   =====================================================
   
   Table of Contents:
   1. Members Portal Layout
   2. Dashboard Components (SHARED)
   3. Responsive Design (Dashboard/Mobile)
   4. Admin Button
   5. Access Forms & Authentication
   6. Webmaster Contact Modal
   7. Access Failure Page Styles
   8. Navigation Components (SHARED)
   9. Image Lightbox Styles (SHARED)
   
   SHARED COMPONENTS:
   - Dashboard Cards: Used across dashboard.html, marketplace.html, scores.html
   - Image Lightbox: Used by marketplace.html and scores.html
   - Back Button: Used across member section pages
   - Navigation: Used across member section pages
   ===================================================== */

/* =====================================================
   1. MEMBERS PORTAL LAYOUT
   ===================================================== */

/* Account for fixed navbar */
body {
    padding-top: 70px;
}

/* Main Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--darker-gray) 100%);
    color: var(--text-color);
    padding: 50px 0 60px;
    text-align: center;
}

/* Header Content Layout */
.header-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    min-height: 80px;
}

.header-text {
    text-align: center;
}

/* Admin Quick Link in Header - Left Side */
.admin-quick-link {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-color);
    color: var(--darker-gray);
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-accent);
}

.admin-quick-link:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-color-dim);
    color: var(--darker-gray);
    text-decoration: none;
}

.admin-quick-link i {
    font-size: 1rem;
}

/* Dashboard Title */
.dashboard-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-color);
}

.dashboard-header h1 i {
    margin-right: 10px;
    color: var(--accent-color);
}

/* Dashboard Description */
.dashboard-header p {
    font-size: 1rem;
    opacity: 0.9;
    color: var(--secondary-color);
    margin: 0;
}

/* =====================================================
   2. DASHBOARD COMPONENTS (SHARED)
   ===================================================== */

/* Dashboard components used across member section pages
   - dashboard.html: Primary usage for member dashboard layout
   - Other member pages may inherit these styles for consistency */

/* Main Dashboard Content Area */
.member-portal .dashboard-content {
    padding: 60px 0 60px;
    min-height: 60vh;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 30px auto 30px;
    max-width: 1400px;
}

/* Quick Links Section - Full Width Below Grid */
.quick-links-section {
    max-width: 1400px;
    margin: 40px auto 40px;
}

/* Member Information Card - Consistent with Dashboard Cards */
.dashboard-card .profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-card .member-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dashboard-card .profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--dark-gray);
    margin-bottom: 15px;
}

.dashboard-card .profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--darker-gray);
    flex-shrink: 0;
    overflow: hidden; /* Ensure image doesn't overflow the circle */
}

.dashboard-card .profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.dashboard-card .profile-name-section {
    flex: 1;
}

.dashboard-card .profile-name-section h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.dashboard-card .profile-name-section .profile-email {
    margin: 0;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.dashboard-card .profile-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.dashboard-card .profile-field {
    display: flex;
    flex-direction: column;
    background: var(--primary-color);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--dark-gray);
}

.dashboard-card .profile-field label {
    font-size: 0.7rem;
    color: var(--accent-color);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.dashboard-card .profile-field span {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Edit Profile Button - Consistent with Site Buttons */
.dashboard-card .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--border-radius);
    background: var(--accent-color);
    color: var(--darker-gray);
    border: none;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.dashboard-card .btn-sm:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* =====================================================
   3. RESPONSIVE DESIGN (DASHBOARD/MOBILE)
   ===================================================== */

/* Tablet Styles (1200px and below) */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        max-width: none;
    }
}

/* Tablet and Mobile Styles (768px and below) */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        min-height: auto;
    }
    
    .admin-quick-link {
        position: static;
        order: -1;
        align-self: center;
    }
    
    .auth-status-container {
        position: static;
        order: 1;
    }
    
    .dashboard-header {
        padding: 100px 0 40px;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-card {
        padding: 20px;
    }
    
    .dashboard-card .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dashboard-card .profile-avatar-section {
        justify-content: center;
        text-align: center;
    }
    
    .dashboard-card .profile-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .quick-links {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .members-section {
        padding: 60px 0 40px;
    }
    
    .members-header h1 {
        font-size: 2rem;
    }
    
    .access-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .access-option {
        padding: 25px 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .access-option h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .access-option p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .access-form {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .access-form .form-group {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-bottom: 15px;
    }
    
    .access-form .form-group input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .help-section {
        padding: 25px 20px;
    }
    
    .help-section h3,
    .help-section h4 {
        font-size: 1.1rem;
    }
    
    .help-section p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .auth-user-section {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .auth-actions {
        justify-content: center;
    }
    
    .user-status-bar .status-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .user-identity {
        justify-content: center;
    }
    
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Mobile Styles (480px and below) */
@media (max-width: 480px) {
    .dashboard-header {
        padding: 80px 0 30px;
    }
    
    .dashboard-header h1 {
        font-size: 1.8rem;
    }
    
    .members-header {
        margin-bottom: 30px;
    }
    
    .members-header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    .members-header p {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .dashboard-card {
        padding: 15px;
    }
    
    .quick-links {
        grid-template-columns: 1fr;
    }
    
    .quick-link {
        padding: 15px;
    }
    
    .access-option {
        padding: 20px 12px;
        margin: 0;
    }
    
    .access-option h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .access-option h3 i {
        font-size: 1.2rem;
    }
    
    .access-option p {
        font-size: 0.85rem;
        margin-bottom: 15px;
        line-height: 1.4;
    }
    
    .access-button {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        max-width: 280px;
        box-sizing: border-box;
    }
    
    .help-section {
        padding: 20px 15px;
    }
    
    .help-section h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .help-section h4 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    .help-section p {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 12px;
    }
    
    .contact-link {
        font-size: 0.85rem;
        padding: 8px 0;
        display: inline-block;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .access-button {
        width: 100%;
        text-align: center;
    }
    
    .access-form.active {
        max-height: 900px; /* Extra space for mobile CAPTCHA and error messages */
    }
    
    .form-error-message,
    .form-success-message {
        font-size: 13px !important;
        padding: 10px !important;
        margin: 0 0 15px 0 !important;
    }
    
    .members-section {
        overflow-x: hidden;
        width: 100%;
    }
    
    .members-section .container {
        padding: 0 8px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .access-form {
        padding: 15px 8px;
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .access-form .captcha-container {
        padding: 8px;
        margin: 15px 0;
    }
    
    .access-form .captcha-container .cf-turnstile {
        transform: scale(0.85);
        transform-origin: center;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .auth-user-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .admin-badge, .member-badge {
        margin-left: 0;
        margin-top: 5px;
    }
    
    .user-identity {
        flex-direction: column;
        gap: 5px;
    }
    
    .role-badge {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* Very small screens optimization */
@media (max-width: 360px) {
    .access-option {
        padding: 15px 8px;
    }
    
    .access-form {
        padding: 12px 6px;
    }
    
    .access-form .captcha-container .cf-turnstile {
        transform: scale(0.8);
    }
}

/* Dashboard Card Styling */
.dashboard-card {
    background: var(--darker-gray);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--dark-gray);
    transition: var(--transition);
}

.dashboard-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.dashboard-card h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-links-section h2 {
    white-space: nowrap;
}

.dashboard-card h2 i {
    color: var(--accent-color);
    font-size: 1.3rem;
}

/* Event Items - Basic styling for member dashboard events */
/* For detailed event styling see calendar.css */
.dashboard-events .event-item {
    background: var(--dark-gray);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--darker-gray);
    transition: var(--transition);
}

.dashboard-events .event-item:hover {
    border-color: var(--accent-color);
    background: var(--primary-color);
}

.dashboard-events .event-item h4 {
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 1rem;
}

.dashboard-events .event-item p {
    color: var(--secondary-color);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.dashboard-events .event-item p strong {
    color: var(--text-color);
}

/* News Items - Styling for news displayed in member dashboard */
.dashboard-events .news-item {
    background: var(--dark-gray);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--darker-gray);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-events .news-item:hover {
    border-color: var(--accent-color);
    background: var(--primary-color);
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.dashboard-events .news-item h4 {
    color: var(--text-color);
    margin: 0;
    font-size: 1rem;
    flex: 1;
}

.news-category {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.dashboard-events .news-item p {
    color: var(--secondary-color);
    margin: 0;
    font-size: 0.9rem;
}

.dashboard-events .news-item p strong {
    color: var(--text-color);
}

.news-excerpt {
    line-height: 1.4;
    margin-bottom: 10px !important;
}

.news-link {
    align-self: flex-start;
    margin-top: auto;
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--dark-gray);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--secondary-color);
    transition: var(--transition);
    border: 1px solid var(--darker-gray);
    text-align: center;
}

.quick-link:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.quick-link i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.quick-link span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Buttons in quick-links should match anchor styling */
button.quick-link {
    font: inherit;
}

/* Coming Soon Link Styling */
.quick-link.coming-soon {
    opacity: 0.7;
    cursor: not-allowed;
}

.quick-link.coming-soon:hover {
    background: var(--dark-gray);
    color: var(--secondary-color);
    transform: none;
    border-color: var(--darker-gray);
}

/* =====================================================
   4. ADMIN BUTTON
   ===================================================== */

/* Admin Link Button (appears in members dashboard for admin users) */
.admin-link {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.95), rgba(71, 85, 105, 0.95));
    color: var(--white) !important;
    padding: 8px 14px !important;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 600;
    border: 2px solid rgba(71, 85, 105, 0.4);
    text-shadow: none;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.3);
}

.admin-link.active {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.95), rgba(51, 65, 85, 0.95));
    color: var(--white) !important;
    border: 2px solid rgba(71, 85, 105, 0.6);
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.4);
}

.admin-link:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(71, 85, 105, 1), rgba(51, 65, 85, 1));
    box-shadow: 0 6px 20px rgba(51, 65, 85, 0.5);
    color: var(--white) !important;
}

/* Admin Link Icon Styles */
.nav-link.admin-link i {
    font-size: 0.9rem;
}

.nav-link.admin-link:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* Authentication Status - Compact Style */
.auth-status-container {
    position: absolute;
    right: 0;
    top: 0;
    flex-shrink: 0;
    color: var(--text-color-muted);
    font-size: 0.9rem;
}

.auth-status {
    background: var(--dark-gray);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--darker-gray);
    text-align: center;
}

.auth-status.authenticated {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, var(--accent-color-dim), rgba(212, 175, 55, 0.05));
    text-align: left;
}

.auth-status.loading {
    border-color: var(--secondary-color);
}

.auth-status.error {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.auth-user-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.auth-icon {
    color: var(--accent-color);
    font-size: 1rem;
}

.user-details strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
    color: var(--text-color);
}

.auth-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.auth-user-info i {
    color: var(--accent-color);
}

.auth-actions {
    flex-shrink: 0;
}

#logout-btn {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

#logout-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateY(-1px);
}

#logout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--secondary-color);
}

.loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
    font-size: 1.2rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error Messages */
.error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    color: #dc3545;
}

.error-message i {
    margin-right: 10px;
}

/* Development Notice */
.dev-notice {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
}

/* =====================================================
   5. ACCESS FORMS & AUTHENTICATION
   ===================================================== */

/* Members Portal Main Section */
.members-section {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, var(--darker-gray) 0%, var(--primary-color) 100%);
    min-height: calc(100vh - 80px);
}

/* Members Portal Header */
.members-header {
    text-align: center;
    margin-bottom: 50px;
}

/* Members Logo Display */
.members-logo {
    margin-bottom: 30px;
}

.members-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
}

.members-header h1 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.members-header p {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 1.2rem;
}

.access-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    align-items: start;
}

.access-option {
    background: var(--dark-gray);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    border: 1px solid var(--darker-gray);
    transition: var(--transition);
    text-align: center;
    position: relative;
}

.access-option:hover:not(:has(.access-form.active)):not(:has(.error-reasons)) {
    border-color: var(--accent-color);
    background: var(--primary-color);
}

/* Fallback for browsers without :has() support */
.access-option:hover {
    border-color: var(--accent-color);
    background: var(--primary-color);
}

/* Disable hover effects for access options containing error reasons */
.access-option:has(.error-reasons):hover {
    border-color: var(--darker-gray);
    background: var(--dark-gray);
}

.access-option.form-active:hover {
    border-color: var(--darker-gray);
    background: var(--dark-gray);
}

.access-option h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.access-option p {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}

.access-form {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    text-align: left;
    margin-top: 20px;
    padding: 0 30px;
    background: var(--darker-gray);
    border-radius: var(--border-radius);
    border: 1px solid var(--dark-gray);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.access-form.active {
    opacity: 1;
    visibility: visible;
    max-height: 800px; /* Increased to accommodate error/success messages */
    padding: 30px;
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

/* Form Error and Success Message Styling */
.form-error-message {
    background: #fee !important;
    border: 1px solid #fcc !important;
    color: #a00 !important;
    padding: 12px !important;
    border-radius: var(--border-radius) !important;
    margin: 0 0 20px 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    animation: slideIn 0.3s ease-out;
}

.form-success-message {
    background: #efe !important;
    border: 1px solid #cfc !important;
    color: #060 !important;
    padding: 12px !important;
    border-radius: var(--border-radius) !important;
    margin: 0 0 20px 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    animation: slideIn 0.3s ease-out;
}

.form-error-message a,
.form-success-message a {
    color: inherit !important;
    text-decoration: underline !important;
}

.form-error-message a:hover,
.form-success-message a:hover {
    opacity: 0.8;
}

/* slideIn animation defined at end of file - line ~1510 */

.access-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-color), #b8860b);
    color: var(--primary-color);
    padding: 15px 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.access-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.access-button.secondary {
    background: var(--primary-color);
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.access-button.secondary:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

.access-button.cancel {
    background: var(--dark-gray);
    color: var(--secondary-color);
    border: 2px solid var(--darker-gray);
}

.access-button.cancel:hover {
    background: var(--darker-gray);
    color: var(--text-color);
}

.access-button.submit {
    background: linear-gradient(135deg, var(--accent-color), #b8860b);
    color: var(--primary-color);
    font-weight: 600;
}

.access-button.submit:hover {
    background: linear-gradient(135deg, #b8860b, var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.help-section {
    background: var(--primary-color);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid var(--dark-gray);
    margin-top: 40px;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.help-section h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.help-section p {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1rem;
}

.contact-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin: 0 10px;
}

.contact-link:hover {
    text-decoration: underline;
}

.status-notice {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    color: var(--accent-color);
    font-weight: 500;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Form Styling - Consistent with Contact Form */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--dark-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--primary-color);
    color: var(--text-color);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--secondary-color);
}

/* CAPTCHA Container - Uses shared styling from main.css */
/* Specific styling for access forms */
.access-form .captcha-container {
    margin: 20px 0 25px 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--dark-gray);
}

.form-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Responsive form button layout */
@media (max-width: 480px) {
    .form-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .access-button {
        width: 100%;
        text-align: center;
    }
    
    /* Adjust access form max-height for mobile and form messages */
    .access-form.active {
        max-height: 900px; /* Extra space for mobile CAPTCHA and error messages */
    }
    
    /* Ensure form messages display properly on mobile */
    .form-error-message,
    .form-success-message {
        font-size: 13px !important;
        padding: 10px !important;
        margin: 0 0 15px 0 !important;
    }
}

/* Member profile section */
.member-profile {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--dark-gray);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-icon {
    font-size: 3rem;
    color: var(--accent-color);
}

.profile-details h3 {
    margin: 0 0 5px 0;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.profile-email {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.user-id {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: var(--dark-gray);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Profile Editor Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--primary-color);
    margin: 10% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--dark-gray);
    animation: popupIn 0.3s ease;
    transform-origin: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--dark-gray);
    background: var(--darker-gray);
}

.modal-header h3 {
    color: var(--text-color);
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--accent-color);
}

.close-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-color);
    background: var(--dark-gray);
}

.modal-body {
    padding: 30px;
}

.profile-photo-section {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.profile-photo {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--dark-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--darker-gray);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    background: var(--dark-gray);
    border: 1px solid var(--darker-gray);
    border-radius: var(--border-radius);
    padding: 12px 15px;
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
}

.form-group input[readonly] {
    background: var(--darker-gray);
    color: var(--secondary-color);
    cursor: not-allowed;
}

.form-group small {
    color: var(--secondary-color);
    font-size: 0.8rem;
    margin-top: 5px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popupIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design for modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* User Status Bar */
.user-status-bar {
    background: var(--dark-gray);
    border: 1px solid var(--darker-gray);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 30px;
    transition: var(--transition);
}

.status-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.status-content.authenticated {
    border-left: 4px solid var(--accent-color);
    padding-left: 16px;
}

.status-content.error {
    border-left: 4px solid #dc3545;
    padding-left: 16px;
    color: #dc3545;
}

.user-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.user-identity i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
}

.user-email {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.role-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.role-badge.admin {
    background: var(--accent-color);
    color: var(--primary-color);
}

.role-badge.member {
    background: var(--secondary-color);
    color: var(--text-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.status-indicator .online {
    color: #28a745;
}

/* =====================================================
   6. WEBMASTER CONTACT MODAL
   ===================================================== */

/* Webmaster Contact Modal Styling - Base styles */
/* Contact Modal Styles (shared by member and admin contact modals) */
.contact-modal .modal-content {
    max-width: 500px;
}

.contact-modal .form-info {
    background-color: var(--light-gray);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 4px solid var(--accent-color);
}

.contact-modal .form-info i {
    color: var(--accent-color);
    margin-right: 8px;
}

.contact-modal .form-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-color-dark);
}

/* Contact Modal Responsive Design */
@media (max-width: 768px) {
    .webmaster-contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .webmaster-contact-form .form-actions {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .webmaster-contact-form {
        padding: 15px;
        margin: 10px 0;
    }
}

/* =====================================================
   7. ACCESS FAILURE PAGE STYLES
   ===================================================== */

.error-reasons {
    margin: 20px 0;
    text-align: left;
}

.error-reason {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.error-reason:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.error-reason h4 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-reason h4 i {
    font-size: 1.2em;
}

.error-reason p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text-color);
}

.error-reason p:last-of-type {
    margin-bottom: 15px;
    font-weight: 600;
}

.error-reason .access-button {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.action-buttons .access-button {
    margin-top: 0;
}

/* Responsive: Stack buttons on small screens */
@media (max-width: 600px) {
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons .access-button {
        text-align: center;
    }
}

/* =====================================================
   8. NAVIGATION COMPONENTS (SHARED)
   ===================================================== */

/* Back Button - Used across member section pages (scores.html, marketplace.html, etc.) */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    color: var(--accent-color);
    padding: 12px 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.back-button:hover {
    color: #b8860b;
    transform: translateX(-3px);
}

/* =====================================================
   9. IMAGE LIGHTBOX STYLES (SHARED)
   ===================================================== */

/* Image Lightbox System - Used by marketplace.html and scores.html
   Provides popup image viewing with viewport constraints and mobile optimization */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    padding: 2rem;
    box-sizing: border-box;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

#lightbox-image, #lightbox-score-image {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    text-align: center;
    color: white;
    padding: 1rem;
    font-size: 1.1rem;
    max-width: 90vw;
    word-wrap: break-word;
}

/* Mobile lightbox optimization */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: 85vh;
        padding: 1rem;
    }
    
    #lightbox-image, #lightbox-score-image {
        max-width: 95vw;
        max-height: 70vh;
    }
    
    .lightbox-close {
        top: -50px;
        right: -10px;
        font-size: 2.5rem;
        width: 50px;
        height: 50px;
    }
    
    .lightbox-caption {
        font-size: 1rem;
        padding: 0.5rem;
        max-width: 95vw;
    }
}

/* =====================================================
   CAPTCHA FIXES
   ===================================================== */

/* Default CAPTCHA container for request access forms (full width, centered) */
.captcha-container {
    width: 100%;
    margin: 20px 0;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}

/* Compact CAPTCHA container for webmaster contact form (tight fit) */
#publicWebmasterContactForm .captcha-container {
    width: fit-content;
    max-width: 320px;
    margin: 20px auto;
    padding: 10px;
}

.cf-turnstile {
    margin: 0 !important;
    display: inline-block !important;
}

.cf-turnstile iframe {
    margin: 0 auto !important;
    display: block !important;
}

.cf-turnstile > div {
    margin: 0 auto !important;
}
