@font-face {
    font-family: 'Fredoka';
    src: url('fonts/Fredoka/static/Fredoka-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fredoka';
    src: url('fonts/Fredoka/static/Fredoka-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fredoka';
    src: url('fonts/Fredoka/static/Fredoka-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fredoka';
    src: url('fonts/Fredoka/static/Fredoka-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* 1. Root & Core Canvas Layout */
html,
body {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Full Screen Background Video */
.background-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* 2. Liquid Glass Clock Overlay Structure */
.clock-positioner {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}

.liquidGlass-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 2.5rem;

    pointer-events: auto;
    cursor: pointer;

    padding: 1.2rem 3.5rem;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 0, 0, 0.1);

    /* Enhanced transition curve to allow a springy bounce on click release */
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.42, 1.45);
    user-select: none;
    /* Prevents double-clicks from highlighting text */
}

/* --- THE HOVER INTERACTIONS --- */
.liquidGlass-wrapper-interactive:hover {
    transform: scale(1.06);
    padding: 1.5rem 4rem;
    border-radius: 3rem;
    background: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 30px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 255, 255, 0.1);
}

/* --- THE CLICK (BOUNCY ACTIVE) STATE --- */
.liquidGlass-wrapper-interactive:active {
    /* Squishes the height down (0.92) while stretching width out (1.12) slightly */
    transform: scale(1.12, 0.92);

    /* Compresses the padding slightly to simulate physical pressure */
    padding: 1.1rem 4.2rem;

    /* Flattens the drop shadow against the background video */
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.4),
        0 0 10px rgba(255, 255, 255, 0.05);

    /* Accelerates the click-down animation speed */
    transition: all 0.1s ease-out;
}

/* Synchronize inner child layer shapes during transitions */
.liquidGlass-wrapper>div {
    border-radius: 2.5rem;
    transition: border-radius 0.5s ease;
}

.liquidGlass-wrapper-interactive:hover>div {
    border-radius: 3rem;
}

/* Dynamic refraction map across the background stream */
.liquidGlass-effect {
    position: absolute;
    z-index: 0;
    inset: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    filter: url(#glass-distortion);
    overflow: hidden;
}

/* Frosting tint barrier */
.liquidGlass-tint {
    z-index: 1;
    position: absolute;
    inset: 0;
}

/* Gloss highlights and deep internal lighting curves */
.liquidGlass-shine {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    box-shadow:
        inset 3px 3px 2px 0 rgba(255, 255, 255, 0.4),
        inset -2px -2px 2px 1px rgba(255, 255, 255, 0.2);
    transition: box-shadow 0.5s ease !important;
}

.liquidGlass-wrapper:hover .liquidGlass-shine {
    box-shadow:
        inset 5px 5px 4px 0 rgba(255, 255, 255, 0.6),
        inset -3px -3px 3px 1px rgba(255, 255, 255, 0.3);
}

/* Puffy Clock Typography Shell */
.liquidGlass-text {
    z-index: 3;
    position: relative;
}

.clock-time {
    font-family: 'Fredoka', sans-serif;
    font-size: 5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.5s ease;
}

.liquidGlass-wrapper:hover .clock-time {
    letter-spacing: 4px;
    text-shadow: 0px 6px 16px rgba(0, 0, 0, 0.3);
}

/* Warps the text layout mildly inside the pressed capsule */
.liquidGlass-wrapper:active .clock-time {
    letter-spacing: 6px;
    transform: scale(0.95, 1.05);
    /* Counter-stretches text so numbers stay legible */
    transition: all 0.1s ease-out;
}

.clock-subtext {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 5px 0;
}

.search-container {
    position: absolute;
    bottom: 90px;
    /* Positions it nicely at the bottom of the screen */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 100%;
    max-width: 450px;
}

.glass-search {
    width: 100%;
    padding: 14px 25px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: 1.5px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    color: #fff;
    outline: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.glass-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Interaction Focus Effects */
.glass-search:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    /* Smooth width pop on focus */
}

/* --- DOCK & SETTINGS STYLES --- */
.dock-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
}

.small-dock {
    padding: 0.6rem 1.8rem !important;
    border-radius: 1.8rem !important;
}

.dock-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.dock-links a {
    font-size: 1.8rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: inline-block;
}

.dock-links a:hover {
    transform: scale(1.3) translateY(-4px);
}

/* Settings Gear Toggle Button */
.dock-settings-btn {
    position: absolute;
    z-index: 2;
    bottom: 23px;
    right: 23px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 3.2rem;
    height: 3.2rem;
}

.dock-settings-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* --- SETTINGS MODAL GLASS VIEW --- */
.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4); /* Background appears instantly */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Toggle visibility instantly so we don't choke the SVG filter */
    opacity: 0;
    pointer-events: none;
}

/* Target the inner glass container inside the modal */
.settings-modal .modal-content {
    /* Instead of fading, we smoothly scale it into view */
    transform: scale(0) rotate(5deg); 
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- THE ACTIVE STATE --- */
.settings-modal.active {
    opacity: 1; /* Snaps on instantly */
    pointer-events: auto;
}

/* When active, pop the glass content out smoothly */
.settings-modal.active .modal-content {
    transform: scale(1) rotate(0deg);
}

.modal-content:hover {
    transform: none !important;
    /* padding: 1.5rem 4rem; */
    /* border-radius: 3rem; */
    background: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 30px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 255, 255, 0.1);
}

.modal-inner {
    width: 100%;
    color: white;
    font-family: 'Fredoka', sans-serif;
}

.modal-inner h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    text-align: center;
}

/* Input rows for settings editor */
.link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.link-row input {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: inherit;
    outline: none;
}

.input-emoji {
    width: 50px;
    text-align: center;
    font-size: 1.2rem;
}

.input-url {
    flex-grow: 1;
}

/* Buttons styles */
.glass-btn {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.remove-btn {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.save-btn {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
}

.save-btn:hover {
    background: rgba(34, 197, 94, 0.4);
}

/* --- SETTINGS LABELS --- */
.setting-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.modal-divider {
    border: 0; 
    border-top: 1px solid rgba(255, 255, 255, 0.15); 
    margin: 1.5rem 0;
}

/* --- AMBIENT SOUND MIXER GRID --- */
.sound-mixer-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 1rem;
    width: 100%;
}

.sound-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sound-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Enabled/Active Mixing State Styling */
.sound-card.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        inset 0 0 12px rgba(255, 255, 255, 0.15),
        0 8px 20px rgba(0, 0, 0, 0.3);
}

.sound-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
    transition: transform 0.3s ease;
}

.sound-card.active .sound-icon {
    transform: scale(1.2);
}

.sound-name {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.sound-card.active .sound-name {
    opacity: 1;
}