@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&display=swap');

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

:root {
    --bg-start: #f3f4f6;
    --bg-end: #f7c8d3;
    --text-color: #333;
    --header-bg: #333;
    --header-text: #fff;
    --accent: #f7c8d3;
    --accent-strong: #b33b63;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --panel-radius: 16px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(120deg, var(--bg-start), var(--bg-end)); 
    color: var(--text-color);
    text-align: center;
    overflow-x: hidden; 
    overflow-y: auto;      
    user-select: none;
}

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Шапка */
header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

header p {
    margin: 10px 0 0;
    font-size: 1rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

/* Profile Section */
.profile-section {
    text-align: center;
    height: 345px;
    background: var(--panel-bg);
    padding: 2rem;
    border-radius: var(--panel-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* News Carousel */
.news-carousel {
    position: relative;
    background: var(--panel-bg);
    padding: 2rem;
    height: 410px;
    position: relative;
    box-sizing: border-box; 
    border-radius: var(--panel-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;     
    justify-content: center; 
}


.carousel-container {
    overflow: hidden;
    position: relative;

    display: flex;
    align-items: center; 
    justify-content: center;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    width: 100%;
}

.news-item {
    flex: 0 0 100%;
    width: 100%;
    padding: 0rem;
    text-align: center;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.news-item img {
    max-width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 0.5rem;
    margin-bottom: 1rem;

    display: block;
    margin-left: auto;
    margin-right: auto;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    border: 2px solid var(--accent);
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 2;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.carousel-button:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
    left: 1rem;
}

.carousel-button.next {
    right: 1rem;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
}

/* ===== Radio widget ===== */
.radio-widget {
    background: var(--panel-bg);
    padding: 1.5rem;
    border-radius: var(--panel-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    color: #222;
    min-width: 220px;
}

.radio-widget h2 {
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
    text-align: center;
}

.radio-left {
    display: flex;
    flex-direction: column; 
    justify-content: space-between; 
    align-items: flex-start;
    width: 120px;
    height: 120px; 
    flex-shrink: 0;
}

.knob {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #444 0%, #222 100%);
    border-radius: 50%;
    position: relative;
    cursor: grab;
    transition: transform 0.3s ease-out; 
}

.knob:active {
    cursor: grabbing;
}

.knob-indicator {
    width: 4px;
    height: 20px;
    background: var(--accent);
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.knob:hover {
    transform: none; 
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.radio-inner {
    display: flex;
    flex-direction: column; 
    gap: 0rem;
    align-items: center;
}

.radio-right {
    flex: 1 1 0; 
    min-width: 0; 
    display: flex;
    flex-direction: column;
    width: 125px;
    gap: 0.6rem;
}
.radio-top {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.radio-bottom {
    display: flex;
    justify-content: center; 
    gap: 1rem;
    width: 100%;
}

.frequency-display {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.frequency-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-strong);
}

/* scale */
.frequency-scale {
    position: relative;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(0,0,0,0.04), rgba(0,0,0,0.02));
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.scale-track {
    display: flex;
    gap: 6px;
    width: 100%;
    align-items: center;
    position: relative;
    justify-content: center;
}

.tick {
    display: inline-block;
    width: 3px;
    height: 14px;
    background: rgba(0,0,0,0.25);
    border-radius: 2px;
}

.tick.small {
    height: 8px;
    width: 2px;
    opacity: 0.65;
}

.scale-pointer {
    position: absolute;
    left: 30%;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 20px;
    background: var(--accent-strong);
    box-shadow: 0 0 6px rgba(179,59,99,0.35);
    border-radius: 2px;
}

.station-name {
    font-size: 0.9rem;
    color: #444;
    opacity: 0.95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* controls */
.radio-controls {
    display: flex;
    align-items: center;
    gap: 0rem;
    margin-top: 0.2rem;
    overflow: wrap;
    width: 100%;
    text-overflow: ellipsis;
}

/* Кнопка и подсказка */
.play-btn {
    display: inline-flex;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.play-btn .triangle {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 10px solid #fff;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    transform: translateX(2px);
    opacity: 0.9;
}

.play-btn.playing {
    background: var(--accent-strong);
}

/* Custom Volume Slider Styles */
.volume-slider-container {
    width: 100%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    flex-grow: 1;
}

.volume-slider-progress {
    height: 100%;
    background-color: var(--accent-strong);
    border-radius: 3px;
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.volume-slider-thumb {
    width: 16px;
    height: 16px;
    background-color: white;
    border: 2px solid var(--accent-strong);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(0, -50%);
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.control-hint {
    display: none;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 1024px) {
    .right-column {
        gap: 1rem;
    }
    .radio-left { width: 100px; }
    .knob { width: 96px; height: 96px; }
}

@media (max-width: 767px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .right-column {
        width: 100%;
        gap: 0.8rem;
    }
    .radio-inner {
        flex-direction: row;
        gap: 0.7rem;
    }
    .knob { margin: 0; }
}

/* Media Queries */
@media (min-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr 2fr 1fr;
        gap: 2rem;
        padding: 2rem;
    }
}

.weather-widget {
    background: var(--panel-bg);
    padding: 2rem;
    border-radius: var(--panel-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    height: min-content;
    text-align: center;
}

.weather-info {
    margin-top: 1rem;
}

.weather-loading {
    color: #666;
    font-style: italic;
}

#weather-info {
    font-size: 0.9rem;
}

.weather-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto auto;
    column-gap: 1rem;
    row-gap: 0.15rem;
    align-items: start;
    text-align: left;
}

.weather-name { grid-column: 1; grid-row: 1; }
.weather-temperature { grid-column: 1; grid-row: 2; }
.weather-description { grid-column: 1; grid-row: 3; }
.weather-humidity { grid-column: 1; grid-row: 4; }

.weather-icon-wrap {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
}

.weather-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.weather-name {
    margin: 0;
    font-size: 0.95rem;
}

.weather-temperature {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-strong);
}

.weather-description,
.weather-humidity {
    font-size: 0.85rem;
    color: #555;
}

.weather-widget h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.weather-toggle {
    margin: 10px 0;
    padding: 8px 16px;
    background-color: var(--accent);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.weather-toggle:hover {
    background-color: var(--accent);
}

@media (max-width: 767px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        margin: 0;
        width: 100%;
    }
    
    .carousel-button {
        width: 30px;
        height: 30px;
    }
    
    .profile-section,
    .news-carousel {
        padding: 1rem;
        margin: 0 auto;
        width: 100%;
    }
}

.text-container h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.text-container p {
    line-height: 1.5;
    font-size: 1rem;
}

/* Основной блок */
main {
    margin: 40px auto;
    padding: 20px;
}

nav a {
    text-decoration: none; 
    border: none; 
    display: inline-block; 
}

nav a:hover {
    background-color: none;
    transform: scale(1.05);
}

/* Стили для SVG кнопок */
nav a.icon-button {
    display: inline-flex; 
    justify-content: center; 
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: transparent; 
    border: none; 
    padding: 0;
    cursor: pointer; 
}

nav a.icon-button svg {
    width: 40px;
    height: 40px;
}

nav a:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

nav a.icon-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease; /* Плавный эффект */
}

nav a.icon-button:hover {
    background-color: #0056b3;
    transform: scale(1.1); 
}

nav a.icon-button svg {
    width: 40px;
    height: 40px;
    transition: filter 0.3s ease;
}

nav a.icon-button:hover svg {
    filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, 0.5)); 
}

/* Профиль */
.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    text-align: center;
}

/* Иконка профиля */
.profile-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.falling-images-container {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
}

/* Общие стили для падающих картинок */
@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Стили для картинок */
.falling-image {
    position: absolute;
    top: -100px;
    pointer-events: none;
    will-change: transform, opacity;
    animation: fall linear infinite; 
    object-fit: contain;
}

.falling-image:nth-child(1) {
    animation-duration: 15s;
    animation-delay: 0s;
    width: 50px;
}

.falling-image:nth-child(2) {
    animation-duration: 20s;
    animation-delay: 3s;
    width: 60px;
}

.falling-image:nth-child(3) {
    animation-duration: 18s;
    animation-delay: 5s;
    width: 40px;
}

.falling-image:nth-child(4) {
    animation-duration: 22s;
    animation-delay: 2s;
    width: 55px;
}

footer {
    margin-top: auto;
    padding: 20px 0;
    background-color: var(--header-bg);
    color: var(--header-text);
    font-size: 0.9rem;
    position: relative;
}

.footer-clock {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    height: 2.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
    font-family: 'Orbitron', 'Arial', sans-serif;
    color: var(--accent);
    max-width: calc(100% - 140px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clock-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.settings-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: var(--header-text);
    cursor: pointer;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

.settings-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.settings-panel {
    position: absolute;
    right: 12px;
    top: calc(100% + 8px);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-color);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 10px 12px;
    display: grid;
    gap: 8px;
    min-width: 220px;
    max-width: calc(100vw - 24px);
    z-index: 10;
}

.settings-panel[hidden] {
    display: none;
}

.settings-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--header-bg);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8rem;
}

.settings-row input[type="color"] {
    width: 42px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.settings-row input[type="range"] {
    width: 120px;
}

.settings-reset {
    border: none;
    background: var(--accent);
    color: var(--text-color);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
}

.settings-reset:hover {
    background: var(--accent-strong);
    color: #fff;
}