/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Glass Tokens - Darker Default */
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --glass-blur: blur(20px);

    /* Text */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-light: #f8fafc;

    /* Accent */
    --accent-color: #6366f1;

    /* Transitions */
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    color: var(--text-primary);
    background: #020617;
    /* Deepest dark */
    overflow-x: hidden;
    transition: background 1s ease;
}

/* Dynamic Gradients - Darker Versions */
body.morning {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

body.afternoon {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

body.evening {
    background: linear-gradient(135deg, #020617 0%, #1e1b4b 100%);
}

.background-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 20s infinite;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(100px, 100px) rotate(180deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Glass Container */
.glass-panel {
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    border: var(--glass-border);
    padding: 2rem;
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.05em;
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Inputs & buttons */
input,
textarea,
select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    /* Darker input bg */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-light);
    font-family: inherit;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Custom Glass Dropdown */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem !important;
    cursor: pointer;
}

select option {
    background: #0f172a;
    /* Dark background for options */
    color: #f8fafc;
    padding: 10px;
}

.btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease-elastic);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    backdrop-filter: blur(4px);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #4f46e5;
}

/* Streak Flame */
.streak-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    background: rgba(255, 165, 0, 0.1);
    color: #fba919;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 165, 0, 0.2);
}

/* Detailed Editor Toolbar */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
    background: #f1f5f9;
    /* Light toolbar */
    border-radius: 8px;
    padding: 6px;
    border: 1px solid #cbd5e1;
    color: #334155;
    align-items: center;
}

/* Editor Paper */
#editor-paper-container {
    background: #ffffff;
    border-radius: 8px;
    color: #1e293b;
    /* Dark text on white paper */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

#editor {
    padding: 24px;
    flex-grow: 1;
    outline: none;
    line-height: 1.6;
    font-size: 1.1rem;
    color: #334155;
}

/* Toolbar Groups */
.toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 8px;
    margin-right: 8px;
    border-right: 1px solid #cbd5e1;
}

.toolbar-group:last-child {
    border-right: none;
    margin-right: 0;
}

.tool-btn {
    background: transparent;
    border: none;
    color: #475569;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.tool-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.tool-select {
    background-color: transparent;
    border: 1px solid transparent;
    color: #475569;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
    padding-right: 24px;
    /* Room for arrow */
    border-radius: 4px;
    height: 32px;
    outline: none;
    /* Dark Arrow for Light Toolbar */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 0.8em;
}

.tool-select:hover {
    background-color: #e2e8f0;
}

/* Entry Cards */
.entry-card {
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    border-radius: 16px;
}

.entry-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
}

/* Panic Mode */
#panic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    color: #333;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Heatmap Grid */
.heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12px, 1fr));
    gap: 4px;
    margin-top: 1rem;
}

.heatmap-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.05);
}

.heatmap-cell.active {
    background: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Print */
@media print {

    .nav-header,
    aside,
    .editor-toolbar,
    .btn,
    #home-view {
        display: none !important;
    }

    .glass-panel {
        box-shadow: none;
        border: none;
        background: white;
        color: black;
    }

    body {
        background: white;
        color: black;
    }

    #editor-view {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .glass-panel {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .toolbar-group {
        border-right: none;
        margin-right: 2px;
    }

    main {
        grid-template-columns: 1fr !important;
    }
}