/* Global Styles & Variables */
:root {
    --primary-color: #E31937; /* Tesla Red */
    --accent-color: #D1495B; /* Desaturated Red */
    --light-bg-color: #F0F0F0;
    --light-text-color: #333333;
    --dark-bg-color: #333333;
    --dark-text-color: #F0F0F0;
    --card-bg-light: #FFFFFF;
    --card-bg-dark: #424242;
    --border-light: #E0E0E0;
    --border-dark: #555555;

    --font-headline: 'Poppins', sans-serif;
    --font-body: 'PT Sans', sans-serif;

    /* Default to light theme */
    --current-bg-color: var(--light-bg-color);
    --current-text-color: var(--light-text-color);
    --current-card-bg: var(--card-bg-light);
    --current-border-color: var(--border-light);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--current-bg-color);
    color: var(--current-text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 20px;
}

/* Theme classes for body */
body.dark-theme {
    --current-bg-color: var(--dark-bg-color);
    --current-text-color: var(--dark-text-color);
    --current-card-bg: var(--card-bg-dark);
    --current-border-color: var(--border-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--current-border-color);
}

header h1 {
    font-family: var(--font-headline);
    color: var(--primary-color);
    font-size: 2.5rem; /* Oversized font */
}

/* Theme Switcher Button */
#theme-toggle-button {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background-color 0.3s ease;
}

#theme-toggle-button:hover {
    background-color: var(--accent-color);
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Changed to 2 columns */
    gap: 20px;
    margin-bottom: 30px;
}

.bento-box {
    background-color: var(--current-card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--current-border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.bento-box:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.bento-box h2 {
    font-family: var(--font-headline);
    color: var(--primary-color);
    font-size: 1.8rem; /* Oversized font */
    margin-bottom: 20px;
}

/* Timer Section */
#timer-section {
    grid-column: span 1; /* Example: make timer span more if needed */
    text-align: center;
}

#timer-display {
    font-family: var(--font-headline);
    font-size: 6rem; /* Oversized font */
    /* color: var(--primary-color); REMOVED for gradient text */
    margin: 20px 0;
    font-weight: 700;
    /* Transparency gradient placeholder - to be refined */
    /* background: linear-gradient(to right, var(--primary-color), var(--accent-color)); */
    /* -webkit-background-clip: text; */
    /* color: transparent; */
}

.timer-controls button {
    padding: 12px 25px;
    margin: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.timer-controls button:hover {
    transform: translateY(-2px);
}

#start-button {
    background-color: var(--primary-color);
    color: white;
}
#start-button:hover {
    background-color: var(--accent-color);
}

#pause-button, #reset-button {
    background-color: #6c757d; /* Bootstrap secondary-like */
    color: white;
}
#pause-button:hover, #reset-button:hover {
    background-color: #5a6268;
}

.cycle-info p {
    margin-top: 15px;
    font-size: 0.9rem;
    padding: 8px; /* Increased padding for better visual separation */
    border-radius: 6px; /* Slightly more rounded corners */
    font-weight: bold; /* Make text bold */
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
}

/* Highlighting for "Current Stage:" */
.cycle-info p:first-child {
    background-color: #e9ecef; /* Light gray for light theme */
    color: #495057; /* Darker text for contrast */
}

/* Highlighting for "Cycles Completed:" */
.cycle-info p:last-child {
    background-color: #dee2e6; /* Slightly different light gray for light theme */
    color: #495057; /* Darker text for contrast */
}

/* Dark theme variants */
body.dark-theme .cycle-info p:first-child {
    background-color: #495057; /* Darker background for dark theme */
    color: #f8f9fa; /* Lighter text for contrast */
}

body.dark-theme .cycle-info p:last-child {
    background-color: #5a6268; /* Slightly different darker background for dark theme */
    color: #f8f9fa; /* Lighter text for contrast */
}


/* Task Manager Section */
#task-manager-section h2 {
    margin-bottom: 15px;
}

#task-form {
    display: flex;
    margin-bottom: 20px;
}

#task-input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--current-border-color);
    border-radius: 5px 0 0 5px;
    font-family: var(--font-body);
    font-size: 1rem;
    background-color: var(--current-bg-color); /* Match body bg */
    color: var(--current-text-color);
}

#task-form button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background-color 0.3s ease;
}

#task-form button:hover {
    background-color: var(--accent-color);
}

#task-list {
    list-style: none;
    padding: 0;
}

#task-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--current-border-color);
    transition: opacity 0.3s ease;
}

#task-list li.completed span {
    text-decoration: line-through;
    color: #777;
    opacity: 0.7; /* Add lower opacity */
}

body.dark-theme #task-list li.completed span {
    color: #aaa; /* Lighter gray for dark theme completed tasks */
    opacity: 0.6;
}

#task-list li:last-child {
    border-bottom: none;
}

#task-list .task-actions button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 10px;
    font-size: 1.1rem;
    color: var(--current-text-color);
}

#task-list .task-actions button.complete-btn:hover {
    color: #28a745; /* Green */
}
#task-list .task-actions button.delete-btn:hover {
    color: var(--primary-color); /* Red */
}

#export-markdown-button {
    margin-top: 20px;
    padding: 10px 15px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background-color 0.3s ease;
}

#export-markdown-button:hover {
    background-color: var(--primary-color);
}

/* Stats Section (Basic Placeholders) */
#stats-section {
    grid-column: span 2; /* Make stats section span both columns */
}

#stats-section p {
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid var(--current-border-color);
    font-size: 0.9rem;
}

/* Framer Motion & Animation Placeholders */
/* Styles for elements that will be animated can be added here or refined later */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px); /* Slightly more pronounced effect */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Transparency gradient for primary color - example */
.primary-gradient-text {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* Apply to timer display if desired */
/* #timer-display { */
/*    background: linear-gradient(to right, var(--primary-color), var(--accent-color)); */
/*    -webkit-background-clip: text; */
/*    -webkit-text-fill-color: transparent; */
/*    background-clip: text; */
/*    text-fill-color: transparent; */
/* } */

/* Responsive Design Adjustments */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr; /* Single column layout on smaller screens */
    }

    #timer-section,
    #task-manager-section,
    #stats-section {
        grid-column: span 1; /* Ensure all sections span only one column */
    }

    header h1 {
        font-size: 2rem; /* Adjusted font size for smaller screens */
    }

    .bento-box h2 {
        font-size: 1.5rem; /* Adjusted font size for bento box titles */
    }

    #timer-display {
        font-size: 4.5rem; /* Adjusted font size for timer display */
    }

    .timer-controls button {
        padding: 10px 15px; /* Adjust button padding */
        font-size: 0.9rem; /* Adjust button font size */
    }

    #task-form {
        flex-direction: column; /* Stack input and button vertically */
    }

    #task-input {
        border-radius: 5px; /* Adjust border radius when stacked */
        margin-bottom: 10px;
    }

    #task-form button {
        border-radius: 5px; /* Adjust border radius when stacked */
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .bento-box h2 {
        font-size: 1.3rem;
    }

    #timer-display {
        font-size: 3.5rem;
    }

    body {
        padding: 10px; /* Reduce body padding on very small screens */
    }

    .bento-box {
        padding: 15px; /* Reduce bento box padding */
    }
}
