/* public/css/panels.css — Apple-Quality Liquid Glass Design System */

/* ═══ Production Glass Panel (WWDC 2025 spec) ═══ */
.glass-panel {
    --glass-opacity: 0.08;
    --glass-blur: 24px;
    --glass-saturate: 1.6;
    --glass-border-opacity: 0.12;

    position: relative;
    background: rgba(255, 255, 255, var(--glass-opacity));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid rgba(255, 255, 255, var(--glass-border-opacity));
    border-radius: 20px;
    box-shadow:
        0 0 0 0.5px rgba(255, 255, 255, 0.05) inset,
        0 2px 20px rgba(0, 0, 0, 0.15),
        0 0 40px rgba(0, 0, 0, 0.05);
    contain: layout style paint;
    overflow: hidden;
}

/* Specular highlight — top-edge light reflection */
.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        175deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.05) 15%,
        transparent 40%
    );
    pointer-events: none;
    z-index: 1;
}

/* Shimmer border animation */
@property --shimmer-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.glass-panel::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--shimmer-angle) at 50% 50%,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 5%,
        transparent 15%
    );
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    padding: 1px;
    animation: glass-shimmer 8s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes glass-shimmer {
    to { --shimmer-angle: 360deg; }
}

/* ═══ Theme Variants ═══ */
[data-time="night"] .glass-panel,
[data-time="midnight"] .glass-panel {
    --glass-opacity: 0.04;
    --glass-border-opacity: 0.08;
    box-shadow:
        0 0 0 0.5px rgba(255, 255, 255, 0.03) inset,
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(0, 0, 0, 0.1);
}

[data-time="day"] .glass-panel {
    --glass-opacity: 0.55;
    --glass-border-opacity: 0.08;
    background: rgba(255, 255, 255, var(--glass-opacity));
    box-shadow:
        0 0 0 0.5px rgba(255, 255, 255, 0.3) inset,
        0 8px 32px rgba(31, 38, 135, 0.12),
        0 0 20px rgba(0, 0, 0, 0.04);
}

[data-time="dawn"] .glass-panel {
    --glass-opacity: 0.12;
    --glass-border-opacity: 0.1;
}

[data-time="golden"] .glass-panel {
    --glass-opacity: 0.1;
    --glass-border-opacity: 0.12;
}

/* ═══ Glass Entry Animation ═══ */
.glass-enter {
    animation: glassFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes glassFadeIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(8px);
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        backdrop-filter: blur(var(--glass-blur, 24px));
    }
}

/* ═══ Certificate Card Expand ═══ */
.cert-card {
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.cert-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.cert-details-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-card.expanded .cert-details-wrapper {
    grid-template-rows: 1fr;
}

.cert-details-wrapper .cert-details-inner {
    overflow: hidden;
}

.cert-details-inner {
    padding: 0;
    transition: padding 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-card.expanded .cert-details-inner {
    padding: 1rem 0 0 0;
}

.cert-verify-btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 0.75rem;
    transition: all 0.2s;
}

.cert-verify-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

/* ═══ Certificate Overlay Lightbox ═══ */
.cert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.cert-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cert-expanded {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--glass-blur, 24px)) saturate(var(--glass-saturate, 1.6));
    -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(var(--glass-saturate, 1.6));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cert-overlay.active .cert-expanded {
    transform: scale(1);
}

/* ═══ Audio Waveform Canvas ═══ */
.audio-waveform-canvas {
    width: 100%;
    height: 48px;
    display: block;
    opacity: 0.7;
}

/* ═══ Performance: reduce blur on mobile ═══ */
@media (max-width: 768px) {
    .glass-panel {
        --glass-blur: 10px;
        --glass-saturate: 1.3;
    }
    .glass-panel::after {
        animation: none;
    }
}
