/* timezone.css - Timezone Modal Styles */

/* Main Modal Container */
.timezone-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Use viewport height */
    z-index: 99999;
    font-family: 'Courier New', monospace;
    animation: modalFadeIn 0.3s ease;
    overflow-y: auto; /* Make entire modal scrollable */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding: 20px; /* Add padding for better mobile experience */
    box-sizing: border-box; /* Include padding in width/height */
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* Modal Content - REMOVED fixed max-height */
.modal-content {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(0, 30, 10, 0.98) 0%, 
        rgba(0, 40, 15, 0.95) 50%, 
        rgba(0, 20, 5, 0.98) 100%);
    border: 2px solid rgba(0, 255, 65, 0.4);
    border-radius: 20px;
    max-width: 650px;
    width: 100%; /* Use full available width */
    margin: 0 auto; /* Center vertically with JavaScript */
    padding: 25px;
    box-shadow: 0 0 80px rgba(0, 255, 65, 0.4),
                0 0 40px rgba(0, 255, 65, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    animation: contentSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: auto; /* Allow content to determine height */
    box-sizing: border-box; /* Include padding in width */
}

@keyframes contentSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.modal-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 255, 65, 0.3);
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 255, 65, 0.8) 50%, 
        transparent 100%);
}

.modal-header h3 {
    color: #00ff41;
    font-size: 22px;
    margin-bottom: 8px;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.7);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-header h3 i {
    font-size: 20px;
    animation: globeSpin 20s linear infinite;
}

@keyframes globeSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Modal Body */
.modal-body {
    margin: 20px 0;
}

/* Timezone Info Section */
.timezone-info {
    background: rgba(0, 50, 20, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.25);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, 
        rgba(0, 255, 65, 0.08) 0%, 
        rgba(0, 200, 50, 0.08) 100%);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 255, 65, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.info-box i {
    color: #00ff41;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.info-box p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    line-height: 1.5;
    font-size: 13px;
}

.current-time-example {
    padding: 12px;
    background: rgba(0, 40, 15, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.current-time-example h4 {
    color: #00ff88;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.current-time-example h4::before {
    content: '📋';
    font-size: 14px;
}

.current-time-example p {
    color: rgba(255, 255, 255, 0.85);
    margin: 5px 0;
    font-size: 12.5px;
    line-height: 1.4;
}

.current-time-example strong {
    color: #00ff41;
    font-weight: 600;
}

.current-time-example code {
    background: rgba(0, 255, 65, 0.15);
    color: #00ff41;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border: 1px solid rgba(0, 255, 65, 0.3);
}

/* Timezone Selector */
.timezone-selector label {
    display: block;
    color: #00ff41;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timezone-select {
    width: 100%;
    padding: 12px 14px;
    background: linear-gradient(135deg, 
        rgba(0, 40, 15, 0.9) 0%, 
        rgba(0, 30, 10, 0.9) 100%);
    border: 2px solid rgba(0, 255, 65, 0.6);
    border-radius: 8px;
    color: white !important; /* Force white text */
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin-bottom: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300ff41'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
    box-sizing: border-box;
}

/* Dropdown options styling - FIX FOR WHITE TEXT */
.timezone-select option {
    background: rgba(0, 40, 15, 0.95) !important;
    color: white !important;
    padding: 10px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 13px !important;
    border: none !important;
}

.timezone-select option:checked,
.timezone-select option:hover,
.timezone-select option:focus {
    background: rgba(0, 255, 65, 0.3) !important;
    color: #00ff41 !important;
}

.timezone-select:hover {
    border-color: #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

.timezone-select:focus {
    outline: none;
    border-color: #00ff41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    color: #00ff41 !important; /* Green when focused */
}

/* Timezone Preview */
.timezone-preview {
    background: rgba(0, 50, 20, 0.7);
    border: 2px solid rgba(0, 255, 65, 0.25);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.timezone-preview h4 {
    color: #00ff88;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timezone-preview h4::before {
    content: '🕐';
    font-size: 14px;
}

.time-preview-box {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.4) 0%, 
        rgba(0, 30, 10, 0.4) 100%);
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 65, 0.4);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.time-display {
    font-size: 36px;
    font-weight: bold;
    color: #00ff41;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.9);
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.timezone-label {
    font-size: 16px;
    color: #00ff88;
    margin-bottom: 8px;
    font-weight: 600;
    background: rgba(0, 255, 65, 0.1);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid rgba(0, 255, 65, 0.3);
}

.time-desc {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    margin-top: 6px;
}

.utc-time {
    font-size: 11px;
    color: #00ff88;
    margin-top: 6px;
    opacity: 0.9;
    font-family: 'Courier New', monospace;
}

/* Modal Footer - STICKY ON MOBILE */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 2px solid rgba(0, 255, 65, 0.25);
}

.btn-primary, .btn-secondary {
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 130px;
    box-sizing: border-box;
}

.btn-primary {
    background: linear-gradient(135deg, 
        rgba(0, 255, 65, 0.95) 0%, 
        rgba(0, 200, 50, 0.95) 100%);
    color: #000;
    box-shadow: 0 4px 12px rgba(0, 255, 65, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, 
        rgba(0, 255, 65, 1) 0%, 
        rgba(0, 200, 50, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 65, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 255, 65, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.12) 0%, 
        rgba(200, 200, 200, 0.12) 100%);
    color: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(200, 200, 200, 0.2) 100%);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

/* Desktop Styles */
@media (min-width: 769px) {
    .timezone-modal {
        padding: 40px; /* More padding on desktop */
    }
    
    .modal-content {
        max-width: 600px;
        padding: 30px;
        margin: 0 auto; /* Center vertically */
        position: relative;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .modal-header h3 {
        font-size: 24px;
    }
    
    .modal-subtitle {
        font-size: 14px;
    }
    
    .time-display {
        font-size: 42px;
    }
    
    .modal-footer {
        position: static; /* Normal flow on desktop */
        padding-top: 20px;
        margin-top: 20px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 14px 25px;
        font-size: 15px;
        min-width: 150px;
    }
}

/* Tablet Styles */
@media (max-width: 768px) and (min-width: 481px) {
    .modal-content {
        max-width: 85%;
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .time-display {
        font-size: 38px;
    }
    
    .modal-footer {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-primary, .btn-secondary {
        min-width: 140px;
    }
}

/* Mobile Styles */
@media (max-width: 480px) {
    .timezone-modal {
        padding: 10px; /* Less padding on very small screens */
    }
    
    .modal-content {
        max-width: 100%; /* Full width on mobile */
        padding: 20px;
        border-radius: 15px;
    }
    
    .modal-header h3 {
        font-size: 18px;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-subtitle {
        font-size: 12px;
    }
    
    .info-box {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .info-box i {
        margin-top: 0;
    }
    
    .timezone-select {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .timezone-preview {
        padding: 12px;
    }
    
    .time-preview-box {
        padding: 12px;
    }
    
    .time-display {
        font-size: 32px;
    }
    
    .timezone-label {
        font-size: 14px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 14px;
        font-size: 14px;
        min-width: auto;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .modal-content {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .time-display {
        font-size: 28px;
    }
    
    .timezone-label {
        font-size: 13px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 12px;
        font-size: 13px;
    }
}

/* Scrollbar Styling for Modal */
.timezone-modal::-webkit-scrollbar {
    width: 6px;
}

.timezone-modal::-webkit-scrollbar-track {
    background: transparent;
}

.timezone-modal::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 65, 0.5);
    border-radius: 3px;
}

.timezone-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 65, 0.7);
}

/* Firefox scrollbar */
.timezone-modal {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 65, 0.5) transparent;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Ensure dropdown shows properly on all browsers */
select.timezone-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Fix for IE and Edge */
select.timezone-select::-ms-expand {
    display: none;
}

/* Ensure the modal is always on top */
.timezone-modal,
.modal-overlay,
.modal-content {
    z-index: 99999 !important;
}