/* ============================================
   Global Timezone Converter - Stylesheet
   Author: Faisal Imran
   Python Lab Project
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #0f0f0f;
    --bg-input: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #555555;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --border-color: #222222;
    --border-focus: #667eea;
    --success-color: #10b981;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(ellipse at top, #0d0d15 0%, var(--bg-primary) 70%);
}

.background-animation::before,
.background-animation::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.background-animation::before {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -200px;
}

.background-animation::after {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    bottom: -150px;
    left: -150px;
    animation-delay: -10s;
}

.globe {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(102, 126, 234, 0.1), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotate 60s linear infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 30px 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo i {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
}

.logo h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

/* Main Card */
.converter-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.section-header i {
    font-size: 1.2rem;
    color: var(--accent-primary);
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.auto-badge {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.15);
    color: var(--accent-primary);
}

.auto-badge.detected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.auto-badge.not-detected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Your Location Section */
.your-location-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.your-location-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.location-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}

.location-details {
    display: flex;
    flex-direction: column;
}

.country-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.city-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.your-time-display {
    text-align: center;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.current-time {
    display: block;
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
}

.current-date {
    display: block;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.change-location-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.change-location-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(102, 126, 234, 0.05);
}

/* Manual Location */
.manual-location {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Section Divider */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    gap: 16px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.divider-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    box-shadow: var(--shadow-md);
}

/* Target Location Section */
.target-location-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-box > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
    box-shadow: var(--shadow-lg);
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-input);
}

.result-item-info {
    display: flex;
    flex-direction: column;
}

.result-item-country {
    font-weight: 500;
    color: var(--text-primary);
}

.result-item-capital {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-item-continent {
    font-size: 0.75rem;
    color: var(--accent-primary);
    padding: 2px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
}

/* Or Divider */
.or-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 12px 0;
    position: relative;
}

.or-divider::before,
.or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.or-divider::before {
    left: 0;
}

.or-divider::after {
    right: 0;
}

/* Select Groups */
.select-row {
    display: flex;
    gap: 12px;
}

.select-group {
    flex: 1;
}

.select-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.custom-select {
    position: relative;
}

.custom-select select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.custom-select select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.custom-select select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-select select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px;
}

.custom-select i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

/* Result Section */
.result-section {
    margin-top: 20px;
    display: none;
}

.result-section.show {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.result-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

.result-location {
    text-align: center;
}

.result-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.result-place {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.result-time {
    display: block;
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
}

.result-date {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.result-difference {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.diff-arrow {
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.diff-text {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 500;
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: auto;
}

.footer-credit {
    margin-bottom: 12px;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.author {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.author span {
    font-weight: 500;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-tagline i {
    color: #ef4444;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header {
        padding: 24px 0;
    }
    
    .your-location-section,
    .target-location-section,
    .result-card {
        padding: 20px;
    }
    
    .select-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .result-comparison {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .result-difference {
        flex-direction: row;
        justify-content: center;
        padding: 12px 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    header {
        padding: 20px 0;
    }
    
    .logo h1 {
        font-size: 1.6rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .your-location-section,
    .target-location-section,
    .result-card {
        padding: 16px;
        border-radius: var(--radius-md);
    }
    
    .section-header h2 {
        font-size: 1rem;
    }
    
    .country-name {
        font-size: 1.2rem;
    }
    
    .current-time {
        font-size: 2rem;
    }
    
    .location-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .divider-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    footer {
        padding: 24px 0;
    }
    
    .project-title {
        font-size: 1rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .current-time,
    .result-time {
        font-size: 1.8rem;
    }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 10px 20px;
    }
    
    header {
        padding: 15px 0;
    }
    
    .section-divider {
        padding: 12px 0;
    }
    
    footer {
        padding: 15px 0;
    }
}
