:root {
    /* Premium Dark Mode */
    --bg-main: #0f1115;
    --bg-surface: #1a1d24;
    --bg-surface-hover: #232730;
    --bg-elevated: #2a2e39;

    --text-primary: #f0f2f5;
    --text-secondary: #9ba1b0;
    --text-muted: #6b7280;

    --accent-primary: #6366f1;
    /* Indigo */
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-radius-lg: 20px;
    --border-radius-xl: 24px;

    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-elevated: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --border-color: rgba(0, 0, 0, 0.1);

    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

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

/* Background image is set dynamically in JS using week number + day as seed */

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #1a1d24;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    flex: 1;
}

.app-header {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    color: var(--accent-primary);
    width: 40px;
    height: 40px;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Section headers */
.tools-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    background: none;
    -webkit-text-fill-color: unset;
}

.section-header i {
    width: 18px;
    height: 18px;
}

.section-header.private {
    color: var(--accent-amber);
}

.section-header.private h2 {
    color: var(--accent-amber);
}

/* Password Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.modal-icon i {
    width: 26px;
    height: 26px;
}

.modal-box h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.modal-input:focus {
    border-color: var(--accent-amber);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.modal-error {
    color: #f87171;
    font-size: 0.85rem;
    width: 100%;
    text-align: left;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-cancel, .btn-confirm {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-cancel {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn-confirm {
    background: var(--accent-amber);
    color: #000;
}

.btn-confirm:hover {
    opacity: 0.85;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.tool-card {
    background-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

:root[data-theme="light"] .tool-card {
    background-color: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Force legible text over photo backgrounds */
body[class^="day-"] .app-header h1,
body[class*=" day-"] .app-header h1 {
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body[class^="day-"] .subtitle,
body[class*=" day-"] .subtitle {
    color: rgba(255, 255, 255, 0.75);
}

body[class^="day-"] .section-header h2,
body[class*=" day-"] .section-header h2,
body[class^="day-"] .section-header,
body[class*=" day-"] .section-header {
    color: rgba(255, 255, 255, 0.6);
}

body[class^="day-"] .section-header.private,
body[class*=" day-"] .section-header.private,
body[class^="day-"] .section-header.private h2,
body[class*=" day-"] .section-header.private h2 {
    color: var(--accent-amber);
}

.tool-card:hover:not(.disabled) {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.tool-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(0, 0, 0, 0.02);
}

:root[data-theme="dark"] .tool-card.disabled {
    background-color: rgba(255, 255, 255, 0.02);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    width: 28px;
    height: 28px;
}

.card-icon.indigo {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.card-icon.emerald {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
}

.card-icon.amber {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
}

.card-content h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.status.upcoming {
    background-color: var(--bg-elevated);
    color: var(--text-muted);
}

.tool-card .arrow {
    color: var(--text-muted);
    transition: var(--transition);
}

.tool-card:hover:not(.disabled) .arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* Footer */
.app-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-links i {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .app-container {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 2.25rem;
    }
}