/* Meeting Portal Client Styles */

/* Global Body Background - Faded Meeting Image for all pages */
body {
    /* Fallback gradient */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    /* Meeting image overlay */
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), 
                url('https://images.unsplash.com/photo-1560439514-4e9645039924?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80') center center !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    min-height: 100vh !important;
}

/* Extra specific selectors to override theme styles */
html body,
body.home,
body.page,
body.single,
body.archive,
.wp-site-blocks {
    /* Fallback gradient */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    /* Meeting image overlay */
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), 
                url('https://images.unsplash.com/photo-1560439514-4e9645039924?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80') center center !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    min-height: 100vh !important;
}

/* Body Background - Faded Meeting Image for meeting portal pages */
body.meeting-portal-page {
    /* Fallback gradient */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* Meeting image overlay */
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), 
                url('https://images.unsplash.com/photo-1560439514-4e9645039924?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80') center center;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Override for pages containing meeting portal shortcode */
.has-meeting-portal {
    /* Fallback gradient */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    /* Meeting image overlay */
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), 
                url('https://images.unsplash.com/photo-1560439514-4e9645039924?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80') center center !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    min-height: 100vh !important;
}

/* Main Container */
.meeting-portal-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(9px);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Ensure consistent 20px gaps on both sides */
    width: calc(100% - 40px);
    box-sizing: border-box;
    position: relative;
    /* Smooth transitions for responsive changes */
    transition: all 0.3s ease;
}

/* Header */
.meeting-portal-header {
    margin-bottom: 40px;
}

.portal-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.2;
}

.portal-subtitle {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Form Styles */
.meeting-portal-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Button Styles */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #5a6268, #495057);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Message Styles */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 500;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Info Section */
.meeting-portal-info {
    font-size: 14px;
    color: #ffffff;
    font-style: italic;
}

/* Hamburger Menu */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.hamburger-icon {
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 5px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hamburger-icon span {
    width: 100%;
    height: 2px;
    background: #2c3e50;
    transition: all 0.3s ease;
}

.hamburger-icon:hover span {
    background: #3498db;
}

.hamburger-content {
    position: absolute;
    top: 50px;
    right: 0;
    background: #6c757d;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
    min-width: 150px;
}

.hamburger-menu:hover .hamburger-content {
    display: block;
}

.hamburger-content a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    transition: background 0.3s ease;
}

.hamburger-content a:hover {
    background: #5a6268;
    border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile background adjustments */
    body.meeting-portal-page,
    .has-meeting-portal,
    body {
        background-attachment: scroll; /* Better for mobile */
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .meeting-portal-container {
        margin: 15px auto !important; /* Centered with equal margins */
        padding: 25px 15px;
        background: rgba(0, 0, 0, 0.88); /* More opaque on mobile */
        max-width: calc(100vw - 40px) !important; /* Consistent 20px gaps on both sides */
        width: calc(100% - 40px) !important;
        box-sizing: border-box;
        position: relative;
        transition: all 0.3s ease;
    }
    
    .portal-title {
        font-size: 26px;
        line-height: 1.3;
    }
    
    .portal-subtitle {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .form-group input {
        padding: 14px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 6px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 6px;
        min-height: 48px; /* Better touch target */
    }
    
    /* Ensure proper spacing for form elements */
    .form-group {
        margin-bottom: 20px;
    }
    
    .meeting-portal-form {
        margin-bottom: 25px;
    }
}

/* Additional mobile optimization for smaller screens */
@media (max-width: 480px) {
    .meeting-portal-container {
        margin: 10px auto !important;
        padding: 20px 12px;
        max-width: calc(100vw - 40px) !important; /* Maintain 20px gaps */
        width: calc(100% - 40px) !important;
        border-radius: 15px;
        position: relative;
        transition: all 0.3s ease;
    }
    
    .portal-title {
        font-size: 24px;
    }
    
    .portal-subtitle {
        font-size: 13px;
    }
    
    .form-group input,
    .btn {
        font-size: 16px;
        padding: 12px;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .meeting-portal-container {
        margin: 10px auto !important;
        padding: 20px 15px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        max-width: calc(100vw - 40px) !important; /* Consistent 20px gaps */
        width: calc(100% - 40px) !important;
        position: relative;
        transition: all 0.3s ease;
    }
    
    .portal-title {
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .portal-subtitle {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .meeting-portal-form {
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .meeting-portal-container {
        background: rgba(0, 0, 0, 0.88);
        border: 2px solid #ffffff;
    }
}

/* Video Player Styles */
.video-session-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.video-session-header {
    text-align: center;
    margin-bottom: 30px;
}

.video-session-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.session-description {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 0;
}

.video-player-wrapper {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.waiting-message {
    text-align: center;
    padding: 60px 20px;
    color: white;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
}

.waiting-message h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

#countdown-timer {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.time-unit {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 5px;
    margin: 0 5px;
    display: inline-block;
}

.video-ended {
    text-align: center;
    padding: 60px 20px;
    color: white;
    background: linear-gradient(45deg, #11998e 0%, #38ef7d 100%);
}

.video-ended h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

/* Disable text selection and context menu */
.video-player-wrapper {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -khtml-user-select: none;
}

/* Loading States */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.meeting-portal-container {
    animation: fadeIn 0.6s ease-out;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .meeting-portal-container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .portal-title {
        color: #ecf0f1;
    }
    
    .portal-subtitle {
        color: #bdc3c7;
    }
    
    .form-group label {
        color: #ecf0f1;
    }
    
    .form-group input {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .form-group input:focus {
        border-color: #3498db;
    }
    
    .meeting-portal-info {
        color: #bdc3c7;
    }
}

/* Mobile-specific theme overrides to ensure proper container behavior */
@media (max-width: 768px) {
    /* Ensure body and html don't cause horizontal scroll */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Override any theme containers that might interfere */
    .has-meeting-portal .site-main,
    .has-meeting-portal .main-content, 
    .has-meeting-portal .content-area,
    .has-meeting-portal .primary,
    .has-meeting-portal article,
    .has-meeting-portal .entry-content,
    .meeting-portal-page .site-main,
    .meeting-portal-page .main-content,
    .meeting-portal-page .content-area,
    .meeting-portal-page .primary,
    .meeting-portal-page article,
    .meeting-portal-page .entry-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure wp-site-blocks and other WordPress containers don't interfere */
    .has-meeting-portal .wp-site-blocks,
    .meeting-portal-page .wp-site-blocks,
    .has-meeting-portal .wp-block-group,
    .meeting-portal-page .wp-block-group {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Partner login button mobile adjustments */
    .partner-login-button {
        top: 10px !important;
        right: 10px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        border-radius: 20px !important;
        z-index: 10000 !important;
    }
    
    /* Fix any theme-specific issues */
    .meeting-portal-container * {
        box-sizing: border-box !important;
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    .meeting-portal-container {
        margin: 8px auto !important;
        padding: 18px 10px;
        max-width: calc(100vw - 40px) !important; /* Still maintain 20px gaps */
        width: calc(100% - 40px) !important;
        border-radius: 12px;
        position: relative;
        transition: all 0.3s ease;
    }
    
    .portal-title {
        font-size: 22px;
    }
    
    .form-group input,
    .btn {
        padding: 12px 10px;
        font-size: 16px;
    }
    
    .partner-login-button {
        padding: 6px 10px !important;
        font-size: 11px !important;
        top: 8px !important;
        right: 8px !important;
    }
}