:root {
    --bg-color: #121212;       /* deeply dark background */
    --card-bg: #1e1e1e;        /* slightly lighter for cards */
    --input-bg: #2d2d2d;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --accent: #bb86fc;         /* bright purple text */
    --accent-btn: #6200ea;     /* deep purple buttons */
    --danger: #cf6679;         /* soft red */
    --success: #03dac6;        /* soft teal */
}

* {
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; /* removes blue tap box on Android */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
	text-decoration-line: none
}

/* --- App Container --- */
.container {
    width: 100%;
    padding: 20px;
    flex-grow: 1; /* Pushes footer down if you add one */
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

/* --- Header Area --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
}

h1 {
    font-size: 2rem;
    margin: 10px 0;
    color: var(--accent);
    text-align: center;
}

.date {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 30px;
}

/* --- Responsive Cards Wrapper --- */
.cards-wrapper {
    display: flex;
    flex-direction: column; /* Default: Stacked on top of each other for phones */
    gap: 20px; /* Space between the cards */
    margin-bottom: 25px;
}

/* --- Cards (Shift Blocks) --- */
.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    width: 100%; /* Default: Fill the whole screen on phones */
}

/* --- Tablet & Desktop Layout --- */
/* If the screen is wider than 768px (iPads, Laptops, PCs) */
@media (min-width: 768px) {
    .cards-wrapper {
        flex-direction: row; /* Put them side-by-side */
    }
    
    .card {
        flex: 1; /* Make both cards exactly 50% width */
    }
}

h2 {
    margin-top: 0;
    font-size: 1.3rem;
    color: var(--text-main);
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* --- Buttons (Thumb Friendly) --- */
form {
    display: block;
    gap: 10px; /* Space between buttons */
    margin-top: 15px;
}

.btn {
    flex: 1; /* Buttons take equal width */
    padding: 16px; /* Fat finger friendly */
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: transform 0.1s;
}

.btn:active {
    transform: scale(0.96); /* Click effect */
}

.yes { background-color: var(--accent-btn); }
.no { background-color: #333; color: #aaa; }

/* Active state for 'No' to make it clear */
.no:active, .no:hover { background-color: var(--danger); color: white; }


/* --- Inputs (Login/Register) --- */
input {
    width: 100%;
    padding: 16px;
    margin-bottom: 15px;
    background: var(--input-bg);
    border: 1px solid #444;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
}
input:focus {
    outline: none;
    border-color: var(--accent);
}

/* --- Login/Register Links --- */
.auth-container {
    justify-content: center; /* Center login screen */
}
.auth-container h2 { text-align: center; border: none; }
.auth-container p { text-align: center; margin-top: 20px; color: var(--text-muted); }
.auth-container a { color: var(--accent); text-decoration: none; }

/* --- History Table --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 1rem;
}

th {
    text-align: left;
    color: var(--text-muted);
    padding: 10px;
    border-bottom: 1px solid #444;
}

td {
    padding: 14px 10px;
    border-bottom: 1px solid #333;
}

/* Status Colors */
td.yes { color: var(--accent); font-weight: bold; }
td.no { color: var(--danger); }
td.pending { color: var(--text-muted); font-style: italic; }

/* Navigation Links */
.link, .logout {
    display: block;
    text-align: center;
    color: var(--accent);
    text-decoration: none;
    padding: 15px;
    font-size: 1.1rem;
}

.logout { color: var(--danger); font-size: 0.9rem; }

.status-banner {
    text-align: center;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid #333;
    border-radius: 16px;
    background: #181818;
}

/* --- Active Button States (Highlights what you picked) --- */
.active-yes {
    background-color: var(--success) !important;
    color: #121212 !important;
    box-shadow: 0 0 15px rgba(3, 218, 198, 0.4);
}

.active-no {
    background-color: var(--danger) !important;
    color: #fff !important;
    box-shadow: 0 0 15px rgba(207, 102, 121, 0.4);
}

/* --- Reason Boxes --- */
.reason-box {
    display: none; /* Hidden by default */
    width: 100%;
    margin-top: 15px;
    animation: fadeIn 0.3s ease-in-out;
}

.reason-box input {
    margin-bottom: 10px;
}

.save-reason {
    width: 100%;
    background-color: var(--accent);
    color: #121212;
}

.save-reason:hover { background-color: var(--accent-hover); }

/* Tiny text for reasons in the history table */
.history-reason {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: normal;
    margin-top: 4px;
    font-style: italic;
}

/* Smooth fade in for the reason input */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Toggle Switch Styling --- */
.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 12px 16px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 12px;
    font-size: 1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #444;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px; width: 20px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--accent-btn); }
input:checked + .slider:before { transform: translateX(22px); }

#morning_reason_inputs, #evening_reason_inputs {
    animation: fadeIn 0.2s ease-in-out;
}

/* --- Responsive Cards Wrapper --- */
.cards-wrapper {
    display: flex;
    flex-direction: column; /* Default: Stacked on top of each other for phones */
    gap: 20px; /* Space between the cards */
    margin-bottom: 25px;
}

/* --- Cards (Shift Blocks) --- */
.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    width: 100%; /* Default: Fill the whole screen on phones */
}

/* --- Tablet & Desktop Layout --- */
/* If the screen is wider than 768px (PCs, Laptops, iPads) */
@media (min-width: 768px) {
    .cards-wrapper {
        flex-direction: row; /* Put them side-by-side */
        flex-wrap: wrap;     /* Allow the 3rd card to wrap to a new line if needed */
    }
    
    .card {
        flex: 1 1 30%; /* Take up to ~1/3 of the space */
        min-width: 250px; /* Make sure they don't get too skinny */
    }
}

/* --- Logo Styling --- */
.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo-link:hover { opacity: 0.8; }

.app-logo {
    width: 35px; /* Size on phones */
    height: 35px;
}

.logo-text {
    color: var(--text-main);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.purple-text {
    color: var(--accent);
}

/* --- Responsive User Info --- */
.user-info {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.username {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.logout { margin-top: 0; padding: 0; }

/* If screen is wide (PC) make the logo slightly bigger */
@media (min-width: 768px) {
    .app-logo {
        width: 45px;
        height: 45px;
    }
    .logo-text {
        font-size: 1.7rem;
    }
}