/* ===================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   =================================== */
:root {
    /* Brand Colors */
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-primary-hover: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);

    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Text Colors */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-white: #ffffff;

    /* Status Colors */
    --success-bg: #f0fff4;
    --success-text: #22543d;
    --success-border: #9ae6b4;
    --success-color: #48bb78;
    --success-hover: #38a169;

    --error-bg: #fee;
    --error-text: #c53030;
    --error-border: #fed7d7;
    --error-color: #f56565;
    --error-hover: #e53e3e;

    --warning-color: #ed8936;
    --warning-hover: #dd6b20;

    --info-bg: #ebf8ff;
    --info-text: #2c5282;
    --info-border: #3182ce;

    /* Background Colors */
    --bg-body: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-secondary: #f7fafc;
    --bg-dark: #1e293b;

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-round: 20px;
    --radius-circle: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-primary: 0 4px 12px rgba(102, 126, 234, 0.3);
    --shadow-primary-lg: 0 8px 25px rgba(102, 126, 234, 0.3);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Monaco', 'Menlo', monospace;

    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 28px;

    /* Z-index Scale */
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 10000;

    /* Borders */
    --border-width: 1px;
    --border-width-thick: 2px;
    --border-color: #e2e8f0;
    --border-color-dark: #cbd5e0;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Notification Banner */
.notification-banner {
    position: relative;
    margin: 10px auto;
    z-index: 999;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 25px;
    padding: 10px 20px;
    width: 450px;
    max-width: 90%;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.notification-icon {
    width: 20px;
    height: 20px;
    color: #F57C00;
    flex-shrink: 0;
}

.notification-text-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.notification-text {
    color: #424242;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
    padding-left: 100%;
    animation: scrollText 20s linear infinite;
}

@keyframes scrollText {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Authentication Section */
.auth-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1vw;
    flex: 1;
}

.login-container {
    display: flex;
    gap: 2vw;
    align-items: stretch;
    width: 100%;
    max-width: 1280px;
    min-height: 420px;
    position: relative;
    z-index: 1;
    margin: 0 auto;
    margin-bottom: 0;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 1.2rem 1.5rem;
    width: 38%;
    max-width: 450px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    /* Remove high z-index - inherit from parent (z-index: 1) */
}

.content-snippet-card {
    background: white;
    border-radius: 20px;
    padding: 1rem 0.8rem;
    width: 62%;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    /* Remove high z-index - inherit from parent (z-index: 1) */
}

.auth-card:hover {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.content-snippet-card:hover {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

/* Login Footer Section */
.login-footer {
    position: relative;
    width: 100%;
    text-align: center;
}

.footer-image {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    display: block;
}

/* Copyright Caption */
.copyright-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

/* Partner Logos Container */
.partner-logos-container {
    position: absolute;
    bottom: 20px;
    right: 110px;
    background: white;
    border-radius: 20px;
    padding: 12px 18px;
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
}

.partner-logos-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.partner-logos-container .partner-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: all 0.3s ease;
}

/* Legacy WTD Logo Container (kept for backward compatibility) */
.wtd-logo-container {
    position: absolute;
    bottom: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
}

.wtd-logo-container:hover {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.wtd-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: all 0.3s ease;
}

/* Content Snippet Styles */
.snippet-header {
    text-align: center;
    margin-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.snippet-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.snippet-header p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.content-snippet-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-carousel {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 300px;
    flex-shrink: 0;
}

.content-carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
}

.content-carousel-item.active {
    opacity: 1;
    transform: translateX(0);
}

.content-carousel-item.prev {
    opacity: 0;
    transform: translateX(-30px);
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    margin-top: auto;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: #667eea;
    transform: scale(1.2);
}

.carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #666;
    opacity: 0;
}

.content-snippet-card:hover .carousel-controls {
    opacity: 1;
}

.carousel-controls:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #333;
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5px;
}

.carousel-image-container {
    position: relative;
    width: 95%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    margin: 0 auto;
    background: #f1f5f9;
}

.carousel-image-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.carousel-image-container:hover .carousel-image {
    transform: none;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 0.2) 80%,
        transparent 100%
    );
    padding: 20px 16px 16px;
    color: white;
    transition: all 0.3s ease;
}

.carousel-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: white !important;
    line-height: 1.3 !important;
    margin: 0 0 6px 0 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.carousel-date {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
    margin: 0 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.carousel-image-container:hover .carousel-overlay {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(0, 0, 0, 0.3) 80%,
        transparent 100%
    );
}

.snippet-item {
    position: relative;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.snippet-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.snippet-item:last-child {
    margin-bottom: 0;
}

.snippet-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.snippet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    padding: 15px 12px 12px 12px;
    backdrop-filter: blur(2px);
}

.snippet-title {
    font-size: 13px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.snippet-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Logo Container */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    padding: 4px 0;
}

.login-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-melaka {
    height: 55px;
}

.logo-mmx {
    height: 57px;
    margin-top: 8px;
}

.auth-header {
    text-align: center;
    margin-bottom: 12px;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.auth-header p {
    color: #666;
    font-size: 14px;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.6rem;
    margin-top: 0.2rem;
}

.form-group-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 1rem;
}

.form-group-row .form-group {
    margin-bottom: 0;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea::placeholder {
    color: #999;
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 45px; /* Space for toggle button */
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #718096;
    padding: 4px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #4a5568;
}

.password-toggle-btn:focus {
    outline: none;
    color: #667eea;
}

/* Form Field Helpers */
.required {
    color: #e53e3e;
    font-weight: bold;
}

.field-hint {
    color: #718096;
    font-size: 12px;
    margin-top: 4px;
    display: block;
    line-height: 1.4;
}

/* Password policy and confirm password hint states */
#password-policy-hint.valid {
    color: #22543d;
    font-weight: 500;
}

#password-policy-hint.invalid {
    color: #c53030;
    font-weight: 500;
}

#confirm-password-hint.valid {
    color: #22543d;
    font-weight: 500;
}

#confirm-password-hint.invalid {
    color: #c53030;
    font-weight: 500;
}

/* Button Styles */
.auth-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.auth-btn:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    display: inline-block;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background: #fee;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #fed7d7;
    font-size: 14px;
    text-align: center;
}

/* Success Message */
.success-message {
    background: #f0fff4;
    color: #2d7738;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #9ae6b4;
    font-size: 14px;
    text-align: center;
}

/* Forgot Password Section */
.forgot-password-section {
    text-align: center;
}

.forgot-password-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
    padding: 8px;
    font-family: inherit;
}

.forgot-password-btn:hover {
    color: #5a6fd8;
    text-decoration: none;
}

/* Auth Footer */
.auth-footer {
    margin-top: 15px;
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #e1e5e9;
}

.demo-info {
    background: #f7fafc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    color: #4a5568;
}

.demo-info code {
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    color: #2d3748;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .auth-section {
        padding: 3vw;
    }
    
    .login-container {
        gap: 3vw;
        min-height: 60vh;
    }
    
    .auth-card {
        padding: 4vw 3vw;
    }
    
    .content-snippet-card {
        padding: 4vw 3vw;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .notification-banner {
        margin: 15px auto;
        width: 350px;
        padding: 8px 16px;
        gap: 8px;
        border-radius: 20px;
    }

    .notification-icon {
        width: 18px;
        height: 18px;
    }

    .notification-text {
        font-size: 12px;
    }

    .auth-section {
        min-height: 100vh;
        padding: 20px;
    }
    
    .login-container {
        flex-direction: column;
        gap: 20px;
        align-items: center;
        min-height: auto;
        max-width: 450px;
    }
    
    .auth-card {
        padding: 30px 25px;
        width: 100%;
        min-height: auto;
        border-radius: 16px;
        justify-content: flex-start;
    }

    .logo-container {
        gap: 10px;
        margin-bottom: 15px;
    }

    .login-logo {
        height: 50px;
    }

    .logo-melaka {
        height: 55px;
    }

    .logo-mmx {
        height: 45px;
    }

    .content-snippet-card {
        width: 100%;
        min-height: 400px;
        border-radius: 16px;
        justify-content: flex-start;
    }
    
    .content-snippet-container {
        gap: 10px;
    }
    
    .snippet-image {
        height: 110px;
    }
}

@media (max-width: 480px) {
    .notification-banner {
        margin: 10px auto;
        width: 280px;
        padding: 6px 12px;
        gap: 6px;
        border-radius: 18px;
    }

    .notification-icon {
        width: 16px;
        height: 16px;
    }

    .notification-text {
        font-size: 11px;
    }

    .auth-section {
        min-height: 100vh;
        padding: 15px;
    }

    .login-container {
        gap: 15px;
        max-width: 100%;
    }
    
    .auth-card {
        padding: 25px 20px;
    }

    .logo-container {
        gap: 8px;
        margin-bottom: 12px;
    }

    .login-logo {
        height: 40px;
    }

    .logo-melaka {
        height: 45px;
    }

    .logo-mmx {
        height: 35px;
    }

    .copyright-caption {
        bottom: 8px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .partner-logos-container {
        bottom: 8px;
        right: 95px;
        gap: 8px;
        padding: 8px 12px;
    }

    .partner-logos-container .partner-logo {
        height: 35px;
    }

    .wtd-logo-container {
        bottom: 8px;
        right: 10px;
        padding: 8px 10px;
    }

    .wtd-logo {
        height: 40px;
    }

    .content-snippet-card {
        padding: 25px 20px;
        min-height: 350px;
    }
    
    .content-snippet-container {
        gap: 8px;
    }
    
    /* Disable hover effects on touch devices */
    .auth-card:hover,
    .content-snippet-card:hover {
        transform: none;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    }
    
    .snippet-item:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .snippet-image {
        height: 100px;
    }
    
    .copyright-caption {
        bottom: 10px;
        padding: 8px 16px;
        font-size: 12px;
    }

    .partner-logos-container {
        bottom: 10px;
        right: 100px;
        gap: 10px;
        padding: 10px 15px;
    }

    .partner-logos-container .partner-logo {
        height: 45px;
    }

    .wtd-logo-container {
        bottom: 10px;
        right: 15px;
        padding: 10px 12px;
    }

    .wtd-logo {
        height: 50px;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .auth-section {
        padding: 2vw;
    }
    
    .login-container {
        flex-direction: column;
        gap: 3vw;
        max-width: 100%;
        min-height: auto;
    }
    
    .auth-card,
    .content-snippet-card {
        width: 100%;
        max-width: none;
        padding: 1.5rem;
    }
    
    .carousel-content {
        padding: 5px;
    }
    
    .carousel-image-container {
        width: 90%;
        aspect-ratio: 16 / 9;
    }
    
    .carousel-title {
        font-size: 14px !important;
    }
    
    .carousel-date {
        font-size: 11px !important;
    }
    
    .carousel-controls {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
}

/* ===================================
   MODAL STYLES
   =================================== */

/* Base Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 95%;
    overflow: hidden; /* Hidden to preserve rounded corners */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Form inside modal needs flex too for proper scrolling */
.modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Important for flex scroll */
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0; /* Don't shrink header */
}

.modal-header h3 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* Important for flex scroll */
}

.modal-body p {
    margin-bottom: 12px;
    color: #4a5568;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8f9fa;
    flex-shrink: 0; /* Don't shrink footer */
}

/* Button Styles for Modals */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.btn-danger:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ===================================
   SIGNUP AND OTP MODAL STYLES
   =================================== */

/* Wider Signup Modal */
#signup-modal .modal-content {
    max-width: 850px;
    max-height: 95vh;
}

/* 2-Column Grid Layout for Signup Form */
#signup-modal .modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    padding: 24px;
}

/* Full-width fields (Address 1, Address 2, Row containers, Terms, Error) */
#signup-modal .modal-body .form-group:nth-child(5),  /* Address 1 field */
#signup-modal .modal-body .form-group:nth-child(6),  /* Address 2 field */
#signup-modal .modal-body .form-group-row,          /* Postcode/District and Password rows */
#signup-modal .modal-body .form-group:nth-last-child(2),  /* Terms checkbox (second to last) */
#signup-modal .modal-body .error-message {
    grid-column: 1 / -1;
}

/* Ensure form-group-row uses flex for side-by-side layout */
#signup-modal .modal-body .form-group-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

/* Remove bottom margin as grid gap handles spacing */
#signup-modal .modal-body .form-group {
    margin-bottom: 0;
}

/* Signup Link Section */
.signup-link-section {
    margin-top: 15px;
    text-align: center;
}

.signup-link-section p {
    font-size: 14px;
    color: #4a5568;
    margin: 0;
}

/* Link Button Style */
.link-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
    padding: 0;
    font-family: inherit;
}

.link-btn:hover {
    color: #5a67d8;
    text-decoration: none;
}

/* Checkbox Label Styles */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 400;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    gap: 10px;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label a {
    color: #667eea;
    text-decoration: underline;
}

.checkbox-label a:hover {
    color: #5a67d8;
    text-decoration: none;
}

/* OTP Modal Specific Styles */
.otp-instruction {
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.6;
}

.otp-dev-info {
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    color: #333;
    margin: 15px 0;
}

.otp-dev-info span:first-child {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 5px;
    font-weight: normal;
}

.otp-dev-info span:last-child {
    font-size: 28px;
    letter-spacing: 8px;
    display: block;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #667eea;
}

.otp-resend-section {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.otp-resend-section p {
    font-size: 14px;
    color: #4a5568;
    margin: 0;
}

/* Username Verification Modal Styles */
.username-verify-text {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    text-align: center;
}

.username-display {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    text-align: center;
    padding: 12px;
    background-color: #f0f4ff;
    border-radius: 8px;
    margin-bottom: 16px;
    word-break: break-all;
}

/* Verified Badge Styles in User Table */
.users-table .verified-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Enhanced Modal Styles for Signup */
.modal-body .form-group {
    margin-bottom: 18px;
}

.modal-body .form-group:last-of-type {
    margin-bottom: 0;
}

/* Responsive adjustments for signup modal */
@media (max-width: 768px) {
    /* Signup modal back to single column on tablets */
    #signup-modal .modal-content {
        max-width: 95%;
    }

    #signup-modal .modal-body {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Remove full-width specification as everything is full-width in single column */
    #signup-modal .modal-body .form-group:nth-child(5),
    #signup-modal .modal-body .form-group:nth-child(8),
    #signup-modal .modal-body .error-message {
        grid-column: auto;
    }

    .otp-dev-info span:last-child {
        font-size: 24px;
        letter-spacing: 6px;
    }

    .checkbox-label {
        font-size: 13px;
    }

    .checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        max-width: 95%;
    }
    
    .otp-dev-info span:last-child {
        font-size: 20px;
        letter-spacing: 4px;
    }
    
    .signup-link-section p,
    .otp-resend-section p {
        font-size: 13px;
    }
}

/* Terms & Conditions Modal Content Styling */
.terms-content {
    max-width: 100%;
}

.terms-content h1,
.terms-content h2,
.terms-content h3,
.terms-content h4,
.terms-content h5,
.terms-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    color: #333;
}

.terms-content h1 {
    font-size: 1.8em;
}

.terms-content h2 {
    font-size: 1.5em;
}

.terms-content h3 {
    font-size: 1.3em;
}

.terms-content p {
    margin-bottom: 1em;
    text-align: justify;
}

.terms-content ul,
.terms-content ol {
    margin-bottom: 1em;
    margin-left: 1.5em;
    padding-left: 0.5em;
}

.terms-content li {
    margin-bottom: 0.5em;
}

.terms-content strong,
.terms-content b {
    font-weight: 600;
}

.terms-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.terms-content table td,
.terms-content table th {
    padding: 8px;
    border: 1px solid #ddd;
}

.terms-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
}
