/* =========================================
   CSS Variables (Professional/Edgy Theme)
   ========================================= */
:root {
    --bg-color: #f8f9fa;         /* Neutrálne sivé pozadie */
    --container-bg: #ffffff;     /* Čistá biela pre hlavnú kartu */
    --text-main: #1f2937;        /* Takmer čierna (Tailwind gray-800) */
    --text-muted: #6b7280;       /* Tmavšia šedá (gray-500) */
    --primary-blue: #2563eb;     /* Profesionálna modrá (blue-600) */
    --primary-hover: #1d4ed8;
    --accent-green: #059669;     /* Ostrejšia zelená pre úspech (emerald-600) */
    --border-color: #e5e7eb;     /* Svetlosivý okraj (gray-200) */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* Ostrejší, kratší tieň */
    --radius: 6px;               /* Edgy štýl - malé zaoblenie */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Na desktope necentrované úplne vertikálne */
    padding: 40px 20px;
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   Layout Containers (Desktop Grid)
   ========================================= */
.app-container {
    background: var(--container-bg);
    width: 100%;
    max-width: 900px; /* Širší layout pre desktop */
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color); /* Jemný okraj */
}

/* Grid pre hlavný obsah na väčších displejoch */
main.desktop-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    main.desktop-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    
    .left-col {
        position: sticky;
        top: 20px;
    }
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 1.7rem;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* =========================================
   Search Section
   ========================================= */
.search-section {
    position: relative;
    margin-bottom: 25px;
}

input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); /* Jemný vnútorný tieň */
}

input[type="text"]:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); /* Ostrejší focus ring */
}

/* =========================================
   Utility Classes & Buttons
   ========================================= */
.hidden { display: none !important; }

.action-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.optimal-time-banner {
    padding: 12px;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
}

.optimal-time-banner.green-banner {
    background-color: #ecfdf5; /* emerald-50 */
    color: var(--accent-green);
    border: 1px solid #a7f3d0; /* emerald-200 */
}

.optimal-time-banner.warning-banner {
    background-color: #fffbeb; /* amber-50 */
    color: #b45309; /* amber-700 */
    border: 1px solid #fde68a; /* amber-200 */
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    width: 100%;
    border: 1px solid transparent;
}

.btn.primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-hover);
}

.btn.secondary {
    background-color: #ffffff;
    color: var(--text-main);
    border-color: var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn.secondary:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =========================================
   Autocomplete Dropdown
   ========================================= */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-top: 4px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow: hidden;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.1s;
    border-bottom: 1px solid var(--border-color);
}

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

.autocomplete-item:hover {
    background-color: #f3f4f6; /* gray-100 */
}

.autocomplete-item.empty {
    color: var(--text-muted);
    cursor: default;
    background-color: transparent;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* =========================================
   Slider & City Cards (Phase 3)
   ========================================= */
.slider-section {
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f9fafb; /* gray-50 */
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.slider-section label {
    display: block;
    text-align: left; /* Zarovnanie vľavo pre profi vzhľad */
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}

input[type=range] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--primary-blue);
    position: relative;
    z-index: 2;
    margin-top: 15px;
}

/* =========================================
   Heatmap
   ========================================= */
.overlap-heatmap {
    display: flex;
    height: 14px;
    width: 100%;
    margin-bottom: -10px; /* Pull slider up */
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--border-color);
    position: relative;
    z-index: 1;
}

.heatmap-hour {
    flex: 1;
    height: 100%;
    border-right: 1px solid rgba(255,255,255,0.3);
}

.heatmap-hour:last-child {
    border-right: none;
}

.heatmap-green { background-color: #34d399; }
.heatmap-yellow { background-color: #fbbf24; }
.heatmap-red { background-color: #ef4444; }

.date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.slider-section .date-row label {
    margin-bottom: 0;
}

input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-main);
    background: #ffffff;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input[type="date"]:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.day-offset {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: right;
    opacity: 0.85;
}

.day-offset.shifted {
    color: #b45309; /* amber-700 (menej krikľavá oranžová) */
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

#current-slider-time {
    font-weight: bold;
    color: var(--primary-blue);
    font-size: 1rem;
    background: transparent;
    padding: 0;
    border: none;
}

.city-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.city-card.green {
    border-left: 4px solid var(--accent-green);
}

.city-card.red {
    border-left: 4px solid #ef4444; /* red-500 */
}

.city-card.green .city-time {
    color: var(--accent-green);
}

.city-card.red .city-time {
    color: #b91c1c; /* red-700 */
}

.city-info h3 {
    margin-bottom: 4px;
    font-size: 1.1rem;
    color: var(--text-main);
}

.city-info .city-tz {
    font-size: 0.8rem;
    opacity: 0.7;
}

.city-time {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-icon {
    font-size: 1.2rem;
}

/* =========================================
   Marketing Hooks (Animations)
   ========================================= */
@keyframes pulse-hook {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); border-color: var(--primary-blue); }
    70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); border-color: var(--border-color); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); border-color: var(--border-color); }
}

.pulse-hook {
    animation: pulse-hook 2.5s infinite;
}

.spinning-globe-inner {
    transform-origin: center;
    animation: spin-earth 6s linear infinite;
}

@keyframes spin-earth {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}
