/* styles.css */

/* 1. Reset default margins, paddings, and box-sizing for consistency */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 2. Ensure the HTML and Body occupy the full viewport and prevent horizontal overflow */
html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden; /* Prevent horizontal scrollbars */
}

/* 3. Base styles for the Body */
body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color, #f0f4f8);
    color: var(--text-color, #333333);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition for theme changes */
    flex-direction: column; /* Allow stacking of setupScreen and shared sections */
}

/* 4. Container Styles for Setup Screen */
.container {
    background-color: var(--countdown-bg-color, #ffffff);
    padding: 2em;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 500px; /* Increased max-width to accommodate tabs */
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 5. Tab Navigation Styles */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 1em;
    border-bottom: 2px solid #ccc;
    width: 100%;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.5em 1em;
    cursor: pointer;
    font-size: 1em;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    outline: none;
    color: var(--text-color, #333333);
}

.tab-button.active {
    border-bottom: 3px solid var(--button-bg-color, #007BFF);
    color: var(--button-bg-color, #007BFF);
}

/* 6. Tab Content Styles */
.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
}

/* 7. Shared Section Styles */
.shared-section {
    background-color: var(--shared-bg-color, #ffffff);
    padding: 1em;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 1.5em auto 0 auto; /* Top margin for spacing, auto for horizontal centering */
    width: 90%;
    max-width: 500px; /* Match the container's max-width */
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition for theme changes */
}

/* Ensure labels, paragraphs, and links are centered within shared sections */
.shared-section label,
.shared-section p,
.shared-section a {
    display: block;
    text-align: center;
    margin-bottom: 0.5em;
    color: var(--text-color, #333333);
    transition: color 0.5s ease; /* Smooth color transition */
}

/* Adjust the width of the select dropdown */
.shared-section select {
    width: 100%;
    padding: 0.5em;
    border: 1px solid #cccccc;
    border-radius: 5px;
    background-color: var(--select-bg-color, #ffffff);
    color: var(--select-text-color, #333333);
    cursor: pointer;
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition */
    font-size: 0.9em; /* Slightly smaller font */
}

/* Adjust link styles */
.shared-section a {
    color: var(--link-color, #007BFF);
    text-decoration: none;
    font-weight: bold;
}

.shared-section a:hover {
    text-decoration: underline;
}

/* 8. Details Section Styles */
.details {
    /* Inherits styles from .shared-section */
}

/* 9. Form Styles */
form {
    margin-bottom: 2em;
}

label {
    display: block;
    margin-bottom: 0.5em;
    color: var(--text-color, #555555);
    transition: color 0.5s ease; /* Smooth color transition */
}

input[type="time"] {
    padding: 0.5em;
    width: 80%;
    margin-bottom: 1em;
    border: 1px solid #cccccc;
    border-radius: 5px;
    background-color: var(--select-bg-color, #ffffff);
    color: var(--select-text-color, #333333);
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition */
}

/* 10. Button Styles */
button {
    padding: 0.5em 1em;
    background-color: var(--button-bg-color, #007BFF);
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease; /* Smooth hover transition */
}

button:hover {
    background-color: var(--button-hover-bg-color, #0056b3);
}

/* 11. Countdown Container Styles */
.countdown-container {
    background-color: var(--countdown-bg-color, #000000);
    color: var(--countdown-text-color, #00FF00);
    
    /* Ensure full coverage */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden; /* Prevent inner overflow */
    
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease;
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition */
}

/* 12. Header Styles */
h1 {
    margin-bottom: 1em;
    color: var(--header-text-color, #333333);
    transition: color 0.5s ease; /* Smooth color transition */
}

/* 13. Time Display Styles */
#timeDisplay {
    font-size: 10em; /* Increased size */
    font-weight: bold;
    color: var(--countdown-text-color, #e7ffe7);
    margin-bottom: 0.5em; /* Spacing below the numbers */
    text-align: center;
    transition: color 0.5s ease; /* Smooth color transition */
}

/* 14. "Remaining Time" Text Styles */
#remainingTimeText {
    font-size: 1.5em; /* Slightly smaller */
    margin-bottom: 2em; /* Spacing below the text */
    color: var(--text-color, #333333);
    transition: color 0.5s ease; /* Smooth color transition */
}

/* 15. Countdown Footer Styles */
.countdown-footer {
    position: absolute;
    bottom: 20px;
    width: 90%;
    max-width: 500px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1em; /* Add horizontal padding */
}

/* 16. Exit Button Styles */
#exitButton {
    padding: 0.5em 1em;
    background-color: var(--exit-button-bg-color, rgba(255, 77, 77, 0.8));
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

#exitButton:hover {
    background-color: var(--exit-button-hover-bg-color, rgba(204, 0, 0, 0.8));
}

/* 17. Theme Selector Styles for Countdown Screen */
.theme-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.theme-selector label {
    margin-bottom: 0.3em;
    font-size: 0.9em;
    color: var(--text-color, #333333);
    transition: color 0.5s ease;
}

.theme-selector select {
    padding: 0.3em;
    border: 1px solid #cccccc;
    border-radius: 5px;
    background-color: var(--select-bg-color, #ffffff);
    color: var(--select-text-color, #333333);
    cursor: pointer;
    transition: background-color 0.5s ease, color 0.5s ease;
    font-size: 0.9em;
}

/* 18. Current Time and Class Status Styles */
#currentTime, #currentClass {
    font-size: 1.2em;
    margin-bottom: 1em;
    transition: color 0.5s ease;
}

/* 19. Start Countdown Button Styles */
#startCountdownButton {
    padding: 0.7em 1.5em;
    background-color: var(--button-bg-color, #007BFF);
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

#startCountdownButton:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#startCountdownButton:not(:disabled):hover {
    background-color: var(--button-hover-bg-color, #0056b3);
}

/* 20. Fade-in Animation for Countdown Screen */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 21. Responsive Adjustments for Smaller Screens */
@media (max-width: 600px) {
    #timeDisplay {
        font-size: 4em;
    }
    #remainingTimeText {
        font-size: 1.2em;
    }
    #exitButton, .theme-selector select, #startCountdownButton {
        font-size: 0.8em;
        padding: 0.4em 0.8em;
    }
    .countdown-footer {
        flex-direction: column;
        gap: 1em;
    }
    .theme-selector {
        width: 100%;
    }
    .tabs {
        flex-direction: column;
        gap: 0.5em;
    }
    .tab-button {
        width: 100%;
    }
    .shared-section {
        padding: 0.8em;
        width: 95%;
    }
    .shared-section select {
        padding: 0.4em;
    }
}

/* =============================================================================
   Additional Styles for Improved Typography and Enhanced Tabs & Quick Time UI
   ============================================================================= */

/* Use Roboto from Google Fonts */
body {
    font-family: 'Roboto', sans-serif;
}

/* Enhanced Tab Styling */
/* Redesigned Tab Container */
.tabs {
    display: flex;
    justify-content: space-around;
    background-color: var(--card-bg-color, #ffffff);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1em;
}

/* Redesigned Tab Buttons */
.tab-button {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    font-size: 1em;
    font-weight: 500;
    color: var(--text-color, #333333);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tab-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tab-button.active {
    background-color: var(--button-bg-color, #007BFF);
    color: #fff;
}

/* Quick Time Container Styles */
.quick-time-container {
    padding: 15px;
    border-radius: 5px;
    background-color: #f8f9fa;
    margin-bottom: 20px;
}

.duration-inputs {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.duration-field {
    display: flex;
    flex-direction: column;
    width: 100px;
}

.duration-field label {
    margin-bottom: 5px;
    font-weight: 500;
}

.duration-field input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Preset button styling */
.preset-btn {
    padding: 8px 12px;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background-color: #dee2e6;
}

/* Primary button styling */
.primary-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--button-bg-color, #007BFF);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.primary-button:hover {
    background-color: var(--button-hover-bg-color, #0056b3);
}