/* --- Quantum Blue Theme for ChronoVault --- */

:root {
    /* --- New Professional Color Palette --- */
    --bg-dark: #0d1117;                     /* Deep Space Blue/Black (User likes this) */
    --panel-bg: rgba(22, 27, 34, 0.85);      /* Semi-Transparent Panel */
    --panel-border: rgba(139, 148, 158, 0.3); /* Subtle Border */

    /* Primary Accent: A strong, clean blue */
    --primary-blue: #007aff;
    --primary-blue-hover: #0056b3;
    --glow-blue: rgba(0, 122, 255, 0.6);

    /* Secondary Accent: A clean, light gray/white */
    --secondary-light: #f8f9fa;
    --secondary-light-hover: #e2e6ea;
    
    /* Highlight Accent (from particles): A bright, electric gold */
    --accent-gold: #ffd60a;

    /* Text Colors */
    --text-primary: #c9d1d9;                /* Soft, light gray */
    --text-secondary: #8b949e;              /* Dimmer gray */
}

/* --- Base Reset & NEW Fonts --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Inter', sans-serif; /* NEW default font */
    background-color: var(--bg-dark); 
    color: var(--text-primary); 
    padding-top: 60px; 
    overflow-x: hidden; 
}

/* Particle Canvas (Unchanged) */
#particle-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }

/* --- Header & Navbar --- */
header { 
    background: rgba(13, 17, 23, 0.7); 
    backdrop-filter: blur(12px); 
    border-bottom: 1px solid var(--panel-border); 
    padding: 0 5%; 
    position: fixed; top: 0; width: 100%; z-index: 1000; 
}
.navbar { display: flex; justify-content: space-between; align-items: center; height: 60px; max-width: 1200px; margin: auto; }

/* Logo */
.logo {
    font-family: 'Poppins', sans-serif; /* NEW font */
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--text-primary); /* Cleaner white logo */
    transition: all 0.3s ease;
}
.logo:hover {
    color: var(--primary-blue);
    transform: scale(1.05) rotate(-3deg); /* NEW Tilt effect */
}

/* Desktop Menu Layout */
.navbar-menu { display: flex; align-items: center; gap: 1.8rem; }
.nav-links { display: flex; gap: 1.2rem; }
.live-info { display: flex; align-items: center; gap: 1rem; color: var(--text-secondary); font-size: 0.85rem; text-align: right; }
#weather-info { display: flex; align-items: center; gap: 0.6rem; font-size: 1.1rem; padding-right: 1rem; border-right: 1px solid var(--panel-border); }
#datetime-info { display: flex; flex-direction: column; }
#current-time { 
    font-family: 'Inter', sans-serif; /* NEW font */
    font-weight: 700;
    font-size: 1.25rem; 
    color: var(--text-primary); 
    letter-spacing: 1px; 
}
.social-links { display: flex; gap: 1.8rem; font-size: 1.25rem; }
.social-links a { color: var(--text-secondary); transition: color 0.3s ease, transform 0.3s ease; }
.social-links a:hover { color: var(--primary-blue); transform: translateY(-3px) scale(1.1); }

/* Hamburger Menu Button */
.hamburger-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.6rem; cursor: pointer; z-index: 1001; }

/* Buttons */
.btn { 
    font-family: 'Poppins', sans-serif; /* NEW font */
    font-weight: 600; /* Slightly lighter */
    border: none; 
    padding: 0.65rem 1.3rem; 
    cursor: pointer; 
    border-radius: 8px; /* Slightly softer radius */
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; 
    transition: all 0.35s ease; 
}

/* Primary buttons are now BLUE */
.btn.primary-btn { 
    background: var(--primary-blue); 
    color: #fff; 
    box-shadow: 0 0 15px var(--glow-blue); 
}
.btn.primary-btn:hover { 
    background: var(--primary-blue-hover); 
    box-shadow: 0 0 28px var(--glow-blue); 
    transform: scale(1.05) rotate(-3deg); /* NEW Tilt effect */
}

/* Secondary buttons are now LIGHT outlines */
.btn.secondary-btn { 
    background: transparent; 
    color: var(--secondary-light); 
    border: 2px solid var(--secondary-light); 
}
.btn.secondary-btn:hover { 
    background: var(--secondary-light); 
    color: var(--bg-dark); 
    box-shadow: 0 0 20px rgba(248, 249, 250, 0.3); 
    transform: scale(1.05) rotate(-3deg); /* NEW Tilt effect */
}

/* Main Container & Panels */
.container { max-width: 850px; margin: 2rem auto; padding: 0 20px; }
.content-panel { 
    background: var(--panel-bg); 
    border: 1px solid var(--panel-border); 
    border-radius: 14px; 
    padding: 2rem; 
    box-shadow: 0 10px 35px rgba(0,0,0,0.5); 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}
.content-panel:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 40px rgba(0,0,0,0.6); 
}
.view.hidden { display: none; }
h2 { 
    font-family: 'Poppins', sans-serif; /* NEW font */
    font-weight: 700;
    font-size: 2rem; 
    text-align: center; 
    margin-bottom: 2rem; 
    color: var(--text-primary); /* Cleaner white heading */
}

/* Form */
#capsule-form { display: flex; flex-direction: column; gap: 1.5rem; }

/* ======== NEW FORM ROW STYLE ======== */
.form-row {
    display: flex;
    gap: 1rem;
}
.form-row .form-group {
    flex: 1; /* Make fields in a row share space */
}
/* ================================== */

.form-group label { 
    display: block; 
    margin-bottom: 0.5rem; 
    color: var(--primary-blue); /* NEW blue labels */
    font-weight: bold; 
    font-family: 'Poppins', sans-serif;
}
.form-group input, .form-group textarea { 
    width: 100%; 
    padding: 0.85rem 1rem; 
    border: 1px solid #30363d; 
    border-radius: 10px; 
    background: #0d1117; 
    color: var(--text-primary); 
    font-family: 'Inter', sans-serif; /* NEW font */
    font-size: 1rem; 
    transition: border-color 0.3s ease, box-shadow 0.3s ease; 
}
.form-group input:focus, .form-group textarea:focus { 
    outline: none; 
    border-color: var(--primary-blue); 
    box-shadow: 0 0 15px var(--glow-blue); 
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator { 
    cursor: pointer; 
    filter: invert(50%) sepia(100%) saturate(1000%) hue-rotate(180deg); /* NEW filter for blue */
    opacity: 0.85; 
    transition: all 0.3s ease; 
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Capsule Cards */
#capsule-list { display: grid; gap: 1.8rem; }
.capsule-card { 
    background: var(--panel-bg); 
    border: 1px solid var(--panel-border); 
    border-radius: 14px; 
    padding: 1.5rem; 
    box-shadow: 0 6px 22px rgba(0,0,0,0.3); 
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease; 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
}
.capsule-card:hover { 
    transform: translateY(-12px); 
    box-shadow: 0 0 30px var(--glow-blue); 
    border-color: var(--primary-blue); 
}
.card-header { display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { 
    font-family: 'Poppins', sans-serif; /* NEW font */
    color: var(--accent-gold); /* Use Gold from particles for card titles */
    font-size: 1.45rem; 
}
.countdown-timer { 
    text-align: center; 
    font-family: 'Inter', sans-serif; /* NEW font */
    font-weight: 700;
    color: var(--text-primary); /* Cleaner white timer */
    font-size: 1.55rem; 
    letter-spacing: 2px;
}
.card-footer { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: auto; }
.card-btn { 
    background: transparent; 
    border: 1px solid #30363d; 
    color: var(--text-secondary); 
    padding: 0.55rem; 
    width: 42px; 
    height: 42px; 
    border-radius: 50%; 
    cursor: pointer; 
    transition: all 0.3s ease; 
}
.card-btn.delete-btn:hover { 
    background: #b22222; 
    color: white; 
    border-color: #b22222; 
    transform: scale(1.1) rotate(-5deg); /* NEW Tilt */
}
.card-btn.edit-btn:hover { 
    background: var(--primary-blue); 
    color: white; 
    border-color: var(--primary-blue); 
    transform: scale(1.1) rotate(-5deg); /* NEW Tilt */
}
.open-btn { 
    width: 100%; 
    font-size: 1rem; 
    background: var(--primary-blue); /* NEW blue */
    color: white; 
    font-family: 'Poppins', sans-serif;
}
.open-btn:hover { 
    background: var(--primary-blue-hover); 
    transform: scale(1.05) rotate(-3deg); /* NEW Tilt */
}

/* Empty Vault Message */
.empty-vault { 
    text-align: center; 
    padding: 3rem 2rem; 
    background: var(--panel-bg); 
    border: 1px dashed var(--panel-border); 
    border-radius: 14px; 
    margin-top: 2rem; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 1rem; 
}
.empty-vault h3 { 
    font-family: 'Poppins', sans-serif; /* NEW font */
    font-size: 1.8rem; 
    color: var(--text-primary); 
    margin-bottom: 0.5rem; 
}
.empty-vault p { color: var(--text-secondary); margin-bottom: 1rem; max-width: 450px; line-height: 1.6; }


/* --- "Blast In" Animation --- */
@keyframes blastIn {
    0% {
        opacity: 0;
        transform: scale(0.7) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Unlocked View */
#unlocked-view .content-panel {
    animation: blastIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.unlocked-content { text-align: center; }

/* ======== NEW LETTER HEADER STYLES ======== */
.letter-header {
    background: var(--bg-dark);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
}
.letter-header strong {
    color: var(--primary-blue);
    font-weight: 700;
}
.letter-from {
    color: var(--text-primary);
}
.letter-to {
    color: var(--text-primary);
    margin-top: 0.5rem;
}
.letter-header span {
    color: var(--text-primary);
    font-weight: 400;
}
/* ======================================== */

.unlocked-title-header {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    color: var(--accent-gold); /* Uses the gold from the particles */
    margin-bottom: 1.5rem;
    text-align: center;
}

#unlocked-message { 
    background: var(--bg-dark); 
    padding: 1.6rem; 
    border-radius: 10px; 
    margin: 1rem 0 2rem 0; 
    font-size: 1.25rem; 
    line-height: 1.6; 
    border-left: 4px solid var(--primary-blue); /* NEW blue */
    text-align: left; 
}
.metadata { color: var(--text-secondary); margin-bottom: 2rem; }
.metadata p { margin: 0.5rem 0; } /* Add spacing */

/* Toast Notifications */
.toast { 
    position: fixed; 
    bottom: 20px; 
    left: 50%; 
    transform: translateX(-50%); 
    padding: 1rem 2rem; 
    border-radius: 8px; 
    color: white; 
    z-index: 2000; 
    opacity: 0; 
    transition: opacity 0.5s, bottom 0.5s; 
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}
.toast.show { opacity: 1; bottom: 30px; }
.toast.success { background-color: var(--primary-blue); } /* NEW blue */
.toast.error { background-color: #c62828; }
.toast.hidden { display: none; }


/* --- Footer --- */
footer {
    width: 100%;
    padding: 2rem 5%;
    background-color: var(--bg-dark); /* Match background */
    border-top: 1px solid var(--panel-border);
    margin-top: 3rem; 
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    text-align: center;
}
.footer-socials { display: flex; gap: 2rem; font-size: 1.5rem; }
.footer-socials a { color: var(--text-secondary); transition: color 0.3s ease, transform 0.3s ease; }
.footer-socials a:hover { color: var(--primary-blue); transform: translateY(-3px); }
.footer-content p { color: var(--text-secondary); font-family: 'Inter', sans-serif; font-size: 0.9rem; }
.footer-credit a { color: var(--text-primary); text-decoration: none; font-weight: 700; transition: color 0.3s ease; }
.footer-credit a:hover { color: var(--primary-blue); text-decoration: underline; }


/* --- Mobile Responsive --- */
@media (max-width: 1024px) {
    .hamburger-btn { display: block; }
    .navbar-menu { 
        position: fixed; 
        top: 60px; 
        right: 0; 
        width: 100%; 
        height: calc(100vh - 60px); 
        background: rgba(13, 17, 23, 0.95); 
        backdrop-filter: blur(12px); 
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        justify-content: center; 
        gap: 3rem; 
        transform: translateX(100%); 
        transition: transform 0.3s ease-in-out; 
    }
    .navbar-menu.active { transform: translateX(0); }
    .navbar-menu .nav-links, .navbar-menu .social-links { flex-direction: column; gap: 2rem; }
    .navbar-menu .btn { padding: 1rem 2rem; font-size: 1.2rem; }
    .navbar-menu .social-links { flex-direction: row; font-size: 2rem; }
    .navbar-menu .live-info { border-top: 1px solid var(--panel-border); padding-top: 2rem; }
}

@media (max-width: 768px) {
    .logo { font-size: 1.3rem; }
    h2 { font-size: 1.6rem; }
    .content-panel { padding: 1.6rem; }

    /* ======== NEW: Stack form rows on mobile ======== */
    .form-row {
        flex-direction: column;
        gap: 1.5rem; /* Same as the main form gap */
    }
    /* ============================================ */
}