@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Raleway:wght@400&family=Roboto:wght@400;700&family=Roboto+Slab:wght@400&display=swap');

/* ==========================================================================
   Body
   ========================================================================== */

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #F0F3F5;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #333; /* Default background color */
    transition: background-color 0.7s;
}

body.work-mode {
    background-color: #EF6F6C;
    transition: background-color 0.7s;
}

body.break-mode {
    background-color: #45a1d6;
    transition: background-color 0.7s;
}

body.long-break-mode {
    background-color: #4CAF50;
    transition: background-color 0.7s;
}

/* Dark theme */
body.dark-theme {
    background-color: #1a1a1a;
    color: #f5f5f5;
}

/* Light theme */
body.light-theme {
    background-color: #f5f5f5;
    color: #333;
}

/* Forest theme */
body.forest-theme {
    background-color: #2E4A3B;
    color: #E8F2EF;
}

/* ==========================================================================
   Header
   ========================================================================== */

.app-header {
    width: 100%;
    font-family: 'Montserrat', sans-serif;
    height: auto;
    padding: 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.app-header h1 {
    font-size: 24px;
    margin: 0;
}

#settings-btn {
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#settings-btn:hover {
    transform: rotate(90deg);
}

#clock {
    font-size: 18px;
    color: #F0F3F5;
    margin-bottom: 5px;
}

/* ==========================================================================
   Timer Container
   ========================================================================== */

.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 20px 0;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    box-shadow: 0 12px 12px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 500px;
    padding: 20px;
}

    /* Timer Toggle Container
    ========================================================================== */

    .toggle-container {
        display: flex;
        justify-content: center;
        width: 100%;
        margin: 0 0 20px 0;
    }

    .toggle-container input[type="radio"] {
        display: none;
    }

    .toggle-label {
        padding: 10px;
        border: 1px solid #F0F3F5;
        cursor: pointer;
        font-size: 14px;
        color: #F0F3F5;
        flex: 1;
        transition: background-color 0.3s, color 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
    }

    .toggle-container input[type="radio"]:checked + .toggle-label {
        background-color: #F0F3F5;
        color: #333;
        font-weight: bold;
    }

    .toggle-container input[type="radio"] + .toggle-label:first-of-type {
        border-radius: 5px 0 0 5px;
    }

    .toggle-container input[type="radio"] + .toggle-label:last-of-type {
        border-radius: 0 5px 5px 0;
    }

    .toggle-container input[type="radio"]:not(:first-of-type) + .toggle-label {
        border-left: none;
    }

    .toggle-container input[type="radio"] + .toggle-label:hover {
        background-color: rgba(240, 243, 245, 0.2);
    }

    /* Timer SVG
    ========================================================================== */

    .timer-svg {
        width: 250px;
        height: 250px;
        margin: 0 auto;
    }

    .timer-circle-bg {
        fill: none;
        stroke: rgba(255, 255, 255, 0.1);
        stroke-width: 10px;
    }

    .timer-circle {
        fill: none;
        stroke: #F0F3F5;
        stroke-width: 10px;
        stroke-dasharray: 565.48;
        stroke-dashoffset: 0;
        transition: stroke-dashoffset 1s, stroke 0.3s;
        transform-origin: center;
    }

    .timer-circle.work-mode {
        stroke: #EF6F6C;
    }

    .timer-circle.break-mode {
        stroke: #45a1d6;
    }

    .timer-circle.long-break-mode {
        stroke: #4CAF50;
    }

    /* Time Display
    ========================================================================== */

    .time-display {
        font-size: 48px;
        font-family: 'Montserrat', sans-serif;
        font-weight: bold;
        margin-top: -140px;
        margin-bottom: 10px;
        position: relative;
        z-index: 2;
    }

    #session-counter {
        font-size: 14px;
        margin-bottom: 100px;
        opacity: 0.8;
    }

    /* Controls Buttons
    ========================================================================== */

    .controls {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        margin-top: 20px;
    }

    .controls button {
        padding: 10px 20px;
        background-color: rgba(255, 255, 255, 0.2);
        color: #F0F3F5;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s, transform 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #stop, #skip {
        padding: 8px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
    }

    #start-pause {
        font-size: 16px;
        font-weight: bold;
        padding: 0 30px;
        height: 40px;
        border-radius: 20px;
        min-width: 120px;
    }

    .controls button:hover {
        background-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-2px);
    }

    .controls button:active {
        transform: translateY(0);
    }

/* ==========================================================================
   Task Container
   ========================================================================== */

.task-container {
    width: 90%;
    max-width: 500px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    box-shadow: 0 12px 12px rgba(0, 0, 0, 0.4);
    padding: 20px;
    margin-bottom: 30px;
}

.task-container h3 {
    margin-top: 0;
    font-size: 20px;
    text-align: center;
}

.task-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#current-task {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #F0F3F5;
    transition: background-color 0.3s;
}

#current-task:focus {
    background-color: rgba(255, 255, 255, 0.2);
    outline: none;
}

#save-task {
    background-color: rgba(255, 255, 255, 0.2);
    color: #F0F3F5;
    transition: background-color 0.3s, transform 0.2s;
}

#save-task:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.task-list-container {
    margin-top: 20px;
}

.task-list-container h4 {
    font-size: 16px;
    margin-bottom: 10px;
    text-align: center;
}

.collection {
    border: none;
    margin: 0;
    background-color: transparent;
}

.collection-item {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #F0F3F5 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 10px 15px !important;
}

.collection-item:last-child {
    border-bottom: none !important;
}

.task-timestamp {
    font-size: 12px;
    opacity: 0.7;
    display: block;
    margin-top: 5px;
}

/* ==========================================================================
   Schedule Container
   ========================================================================== */
.schedule {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Schedule Input
========================================================================== */

.schedule input {
    font-size: 14px;
    height: auto;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #F0F3F5;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 150px;
    text-align: center;
}

.schedule input:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.schedule input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.2);
}

#schedule-status {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
}

/* ==========================================================================
   Modal Styling
   ========================================================================== */

.modal {
    background-color: #333;
    color: #F0F3F5;
    border-radius: 10px;
    max-width: 500px;
}

.modal .modal-content {
    padding: 20px;
}

.modal .modal-footer {
    background-color: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
}

.modal h4 {
    font-size: 20px;
    margin-top: 0;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    color: #F0F3F5;
}

.setting-item input[type="number"] {
    width: 100%;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #F0F3F5;
}

.switch label {
    color: #F0F3F5 !important;
}

.switch label input[type=checkbox]:checked+.lever {
    background-color: rgba(76, 175, 80, 0.5) !important;
}

.switch label input[type=checkbox]:checked+.lever:after {
    background-color: #4CAF50 !important;
}

.theme-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.theme-option {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.theme-option:hover {
    transform: translateY(-5px);
}

.theme-preview {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    margin-bottom: 5px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
}

.theme-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background-color: rgba(0, 0, 0, 0.2);
}

.default-theme {
    background-color: #333;
}

.dark-theme {
    background-color: #1a1a1a;
}

.light-theme {
    background-color: #f5f5f5;
}

.forest-theme {
    background-color: #2E4A3B;
}

.theme-option.active .theme-preview {
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        padding: 10px;
    }
    
    .header-left {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    
    .header-right {
        width: 100%;
        align-items: center;
    }
    
    .timer-svg {
        width: 200px;
        height: 200px;
    }
    
    .time-display {
        font-size: 36px;
        margin-top: -115px;
    }
    
    #session-counter {
        margin-bottom: 80px;
    }
    
    .toggle-label {
        font-size: 12px;
        padding: 8px 5px;
    }
}

/* Dropdown content styling */
.dropdown-content {
    background-color: #333 !important;
    border-radius: 5px !important;
    min-width: 180px !important;
}

.dropdown-content li > a {
    color: #F0F3F5 !important;
}

.dropdown-content li:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Make MaterializeCSS inputs more visible in dark theme */
input:not([type]):focus:not([readonly]),
input[type=text]:not(.browser-default):focus:not([readonly]),
input[type=password]:not(.browser-default):focus:not([readonly]),
input[type=email]:not(.browser-default):focus:not([readonly]),
input[type=url]:not(.browser-default):focus:not([readonly]),
input[type=time]:not(.browser-default):focus:not([readonly]),
input[type=date]:not(.browser-default):focus:not([readonly]),
input[type=datetime]:not(.browser-default):focus:not([readonly]),
input[type=datetime-local]:not(.browser-default):focus:not([readonly]),
input[type=tel]:not(.browser-default):focus:not([readonly]),
input[type=number]:not(.browser-default):focus:not([readonly]),
input[type=search]:not(.browser-default):focus:not([readonly]),
textarea.materialize-textarea:focus:not([readonly]) {
    border-bottom: 1px solid #4CAF50 !important;
    box-shadow: 0 1px 0 0 #4CAF50 !important;
}

/* Override MaterializeCSS button colors */
.btn, .btn-large, .btn-small {
    background-color: #4CAF50 !important;
}

.btn:hover, .btn-large:hover, .btn-small:hover {
    background-color: #3d8b40 !important;
}

/* Timepicker styling */
.timepicker-digital-display {
    background-color: #4CAF50 !important;
}

.timepicker-close {
    color: #4CAF50 !important;
}

.timepicker-canvas line {
    stroke: #4CAF50 !important;
}

.timepicker-canvas-bearing, .timepicker-canvas-bg {
    fill: #4CAF50 !important;
}

.btn-flat {
    color: #4CAF50 !important;
}

/* Fixes for modals */
.modal-overlay {
    z-index: 1000 !important;
}

.modal {
    z-index: 1001 !important;
}

/* Remove conflicting MaterializeCSS styles */
input:not([type]), input[type=text]:not(.browser-default), input[type=password]:not(.browser-default), input[type=email]:not(.browser-default), input[type=url]:not(.browser-default), input[type=time]:not(.browser-default), input[type=date]:not(.browser-default), input[type=datetime]:not(.browser-default), input[type=datetime-local]:not(.browser-default), input[type=tel]:not(.browser-default), input[type=number]:not(.browser-default), input[type=search]:not(.browser-default), textarea.materialize-textarea {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    outline: none;
    height: 3rem;
    width: 100%;
    font-size: 16px;
    margin: 0 0 8px 0;
    padding: 0;
    box-shadow: none;
    box-sizing: content-box;
    transition: box-shadow .3s, border .3s;
    color: #F0F3F5;
}


