/* --------------------------------------------------------------
   LIQUID iOS – CSS (Enhanced Liquid Glass)
-------------------------------------------------------------- */

/* 1. Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #1c1c1e;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;

    /* Living background */
    background: url("bear.jpg") no-repeat center/cover fixed;
    position: relative;
}

/* Subtle animated vignette */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(0,0,0,.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(0,0,0,.12) 0%, transparent 40%);
    animation: breathe 12s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* 2. Enhanced liquid glass variables */
:root {
    --liquid-blur: 25px;
    --liquid-radius: 24px;
    --liquid-highlight: rgba(255, 255, 255, 0.4);
    --liquid-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    --liquid-border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 3. Layout container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* 4. Header styling */
header {
    text-align: center;
    margin-bottom: 8px;
    padding: 32px 24px;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #000;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

header p {
    font-size: 1.1rem;
    color: #636366;
    font-weight: 400;
}

/* 5. Main content area */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* 6. Enhanced liquid glass effect */
.liquid {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(var(--liquid-blur));
    -webkit-backdrop-filter: blur(var(--liquid-blur));
    border-radius: var(--liquid-radius);
    box-shadow: var(--liquid-shadow);
    border: var(--liquid-border);
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.liquid:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.25);
}

/* 7. Dynamic glossy highlight */
.liquid::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.liquid::after {
    content: "";
    position: absolute;
    top: var(--y, 50%);
    left: var(--x, 50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at center, var(--liquid-highlight) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.liquid:hover::after {
    opacity: 0.6;
}

/* 8. Section styling */
.converter-section {
    composes: liquid;
}

.converter-section h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    color: #000;
    letter-spacing: -0.3px;
}

/* 9. Step sections with swapped look */
.step-section {
    background: rgba(255, 255, 255, 0.3); /* lighter transparency (from result-section) */
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
    /* removed blur */
    transition: transform 0.3s ease;
}

.step-section:hover {
    transform: translateY(-2px);
}

.step-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    color: #1c1c1e;
    letter-spacing: -0.2px;
}

/* 10. Input groups with better spacing */
.input-group {
    margin-bottom: 20px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: #1c1c1e;
}

.input-group input[type="time"] {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 500;
}

.input-group input[type="time"]:focus {
    outline: none;
    box-shadow: 
        inset 0 0 0 2px #007AFF,
        0 4px 16px rgba(0, 122, 255, 0.3);
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

/* 11. Enhanced buttons */
.convert-btn, .copy-btn {
    padding: 16px 28px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    color: #1c1c1e;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin: 8px 4px;
    position: relative;
    overflow: hidden;
}

/* 12. Result section with swapped look */
.result-section {
    margin-top: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.4); /* stronger glassy white (from step-section) */
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);              /* blur moved here */
    -webkit-backdrop-filter: blur(10px);      /* Safari support */
}


.convert-btn:hover, .copy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 1);
}

.convert-btn:active, .copy-btn:active {
    transform: translateY(-1px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.copy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}



.final-display {
    margin-bottom: 20px;
}

.final-display label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: #1c1c1e;
}

.final-output {
    font-size: 1.4rem;
    font-weight: 700;
    color: #34C759;
    background: rgba(255, 255, 255, 0.8);
    padding: 16px 20px;
    border-radius: 14px;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* 13. Copy message styling */
.copy-message {
    font-size: 1rem;
    color: #34C759;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    margin-top: 12px;
}

.copy-message.show {
    opacity: 1;
}

/* 14. Mouse tracking for dynamic highlight */
.converter-section {
    cursor: crosshair;
}

/* 15. Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
        gap: 20px;
    }
    
    header {
        padding: 24px 16px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .liquid {
        padding: 24px 20px;
    }
    
    .step-section {
        padding: 20px;
    }
    
    .input-group input[type="time"] {
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    .convert-btn, .copy-btn {
        padding: 14px 20px;
        font-size: 1rem;
        width: 100%;
        margin: 4px 0;
    }
    
    .final-output {
        font-size: 1.2rem;
        padding: 14px 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px 12px;
    }
    
    .liquid {
        padding: 20px 16px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
}

/* 16. JavaScript integration for mouse tracking */
.converter-section {
    position: relative;
}
