/* === BASE STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

body {
    font-family: 'Rubik', sans-serif;
    background-color: #faf4ed;
    padding: 20px;
    color: #575279;
}

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

/* === BUTTONS === */
.btn {
    padding: 10px 20px;
    background-color: #EFE9E3;
    color: #575279;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid transparent;
    outline: none;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.btn:hover {
    border: 2px solid #56949f;
}

.btn:active {
    background-color: #d0d0d0;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: #575279;
    color: #FFFAF3;
}

.btn-primary:hover {
    background-color: #f2e9e1;
    color: #575279;
    border: 2px solid transparent;
}

.btn-danger {
    background-color: #b4637a !important;
    color: #FFFAF3 !important;
}

.btn-danger:hover {
    background-color: #9c4f63 !important;
    border: 2px solid #b4637a !important;
}

.btn-week-nav {
    min-width: 40px;
    padding: 8px 12px;
    font-size: 1rem;
}

/* === HOME PAGE === */
.home-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
    padding: 40px;
    border-radius: 12px;
    margin: 60px auto 20px auto;
    min-height: 70vh;
    animation: fadeSlideIn 1s ease-out both;
}

@keyframes fadeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-text {
    flex: 1;
    min-width: 280px;
}

.hero-text h1 {
    font-size: 4rem;
    font-weight: bold;
    color: #575279;
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-image {
    flex: 1;
    min-width: 280px;
    display: flex;
    justify-content: center;
    animation: floatImage 4s ease-in-out infinite;
    transform: translateY(2px); 
}

.hero-image img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

@keyframes floatImage {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 40px 40px 40px;
    margin-bottom: 40px;
}

.feature-card {
    background-color: #FFFBF5;
    padding: 30px;
    border-radius: 12px;
    text-align: left;
    border: none;
    transition: background-color 0.3s ease;
}


.feature-card:hover {
    background-color: #F0E8E4;
}


.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #575279;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

.feature-card a {
    color: #56949f;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.feature-card a:hover {
    border-bottom: 1px solid #56949f;
}

/* === APP HEADER === */
.header {
    text-align: center;
    margin-bottom: 30px;
    background-color: #fffaf3;
    padding: 20px;
    border-radius: 8px;
}

.app-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.week-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.btn-week-nav {
    min-width: 40px;
    padding: 8px 12px;
    font-size: 1rem;
}

.week-label {
    font-size: 1rem;
    color: #666;
    min-width: 250px;
    text-align: center;
}

/* === AUTH SECTION === */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.user-email {
    color: #575279;
}

/* === MAIN CONTENT === */
.main-content {
    background-color: #fffaf3;
    padding: 20px;
    border-radius: 8px;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: space-between;
    align-items: center;
}

/* === WEEK GRID === */
.week-header {
    display: flex;
    gap: -30px;
    margin-bottom: 20px;
    border-bottom: 2px solid #cecacd;
    padding-bottom: 10px;
}

.task-name-column {
    width: 250px;
    font-weight: bold;
    text-align: left;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    flex: 1;
}

.day-header {
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* === TASKS === */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-row {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 10px;
    background-color: #faf4ed;
    border: 2px solid #cecacd;
}

.task-name-cell {
    width: 250px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    flex-shrink: 0;
}

.task-drag-handle {
    cursor: grab;
    color: #cecacd;
    font-size: 1rem;
    padding: 5px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.task-drag-handle:active {
    cursor: grabbing;
}

.task-row.dragging {
    opacity: 0.5;
}

.task-row.drag-over {
    border-top: 3px solid #56949f;
}

.task-icon {
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.task-name {
    flex: 1;
    word-break: break-word;
    white-space: normal;
}

.task-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-shrink: 0;
}

.task-edit-btn {
    background-color: #f2e9e100;
    border: 2px solid #cecacd00;
    color: #575279;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px 7px;
}

.task-edit-btn:hover {
    color: #56949f;
}

.task-delete-btn {
    background-color: #f2e9e100;
    border: 2px solid #cecacd00;
    color: #575279;
    cursor: pointer;
    font-size: 2rem;
    font-weight: bold;
    padding: 5px 7px;
}

.task-delete-btn:hover {
    color: #b4637a;
}

/* === DAY CELLS === */
.task-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    flex: 1;
}

.day-cell {
    width: 45px;
    height: 45px;
    border: 2px solid #cecacd;
    background-color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-cell:hover:not(.future) {
    background-color: #F0E9E4;
}

.day-cell.empty {
    background-color: #f4ede8 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.day-cell:hover {
    border: 2px solid #56949f;
}

.day-cell.in-progress {
    background-color: #ea9d34 !important;
    color: white !important;
}

.day-cell.completed {
    background-color: #4bbb70 !important;
    color: white !important;
}

.day-cell.future {
    background-color: #dfdad9 !important;
    cursor: not-allowed !important;
    color: #999 !important;
}

.day-cell.future:hover {
    border: 2px solid #cecacd;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 1rem;
}

.empty-state.hidden {
    display: none;
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
}

.modal-overlay.active {
    display: block;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #FAF4ED;
    border-radius: 8px;
    z-index: 1000;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    display: none;
}

.modal.active {
    display: block;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #cecacd;
    padding-bottom: 10px;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    background-color: #fffaf300;
    border: 2px solid #cecacd00;
    font-size: 2rem;
    cursor: pointer;
    font-weight: bold;
    padding: 5px 7px;
    font-weight: bold;
    color: #575279;
}

.modal-close:hover {
    color: #b4637a;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 2px solid #cecacd;
    padding-top: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.cf-turnstile {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    transform: scale(0.7);
    transform-origin: center center;
}

.oauth-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.oauth-buttons .btn {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.oauth-buttons .btn i {
    margin: 0;
    line-height: 1;
}

.email-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.email-input-wrapper .form-input {
    flex: 1;
}

.email-send-btn {
    padding: 10px 16px;
    background-color: #575279;
    color: #FFFAF3;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.email-send-btn:hover {
    background-color: #f2e9e1;
    color: #575279;
    border: 2px solid #56949f;
}

.email-send-btn:active {
    transform: scale(0.95);
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    background-color: #f2e9e1;
}

.form-input:focus {
    outline: none;
    border: 2px solid #56949f;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.icon-option {
    width: 50px;
    height: 50px;
    border: 2px solid #cecacd;
    background-color: #f2e9e1;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-option:hover {
    background-color: #E6DEDC;
}

.icon-option.selected {
    background-color: #f2e9e1;
    border: 2px solid #56949f;
}

/* === TOASTS === */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background-color: #575279;
    color: #FFFAF3;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    pointer-events: auto;
    font-size: 0.95rem;
}

.toast.success {
    background-color: #4bbb70;
}

.toast.error {
    background-color: #b4637a;
}

.toast.info {
    background-color: #56949f;
}

.toast i {
    font-size: 1.2rem;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

/* === ACCOUNT MODAL === */
.account-info {
    background-color: #f2e9e1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.account-info p {
    color: #575279;
}

.account-note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
}

.button-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
    line-height: 1.4;
}

.button-help.warning {
    color: #b4637a;
    font-weight: 500;
}

.danger-zone {
    border-top: 2px solid #cecacd;
    padding-top: 20px;
    margin-top: 20px;
}

.danger-zone h3 {
    color: #b4637a;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

/* === FOOTER === */
.footer {
    padding: 20px;
    margin-top: 40px;
    color: #666;
    font-size: 0.9rem;
    border-top: 2px solid #E6DFDD;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left {
    display: flex;
    align-items: center;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: -2px;
}

.footer a {
    color: #56949f;
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    text-decoration: underline;
}

/* Language Selector */
.language-selector-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.language-select {
    background-color: #f2e9e1;
    color: #575279;
    border: 2px solid #cecacd;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Rubik', sans-serif;
}

.language-select:focus {
    outline: none;
    border-color: #56949f;
}

/* Account Menu Button */
.account-menu-btn {
    min-width: 44px;
    padding: 10px 15px;
}

/* Login Icon Button */
.login-icon-btn {
    min-width: 44px;
    padding: 10px 15px;
}

/* Stats Icon Button */
.stats-icon-btn {
    min-width: 44px;
    padding: 10px 15px;
}

/* Account Modal Sections */
.account-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.account-action-btn {
    flex: 1;
    min-width: 150px;
}

.logout-icon-btn {
    min-width: 44px;
    padding: 10px 15px;
}

.account-language-section {
    border-top: 2px solid #cecacd;
    padding-top: 20px;
    margin-top: 20px;
    margin-bottom: 0;
}

.account-language-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.account-language-label {
    margin: 0;
    display: flex;
    align-items: center;
}

.account-language-label i {
    font-size: 1.2rem;
    color: #575279;
}

/* Auth Modal */
.auth-modal-body {
    margin-bottom: 0;
}

.email-help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    text-align: right;
    margin-bottom: 0;
}

.auth-legal-notice {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #cecacd;
}

.legal-notice {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-top: 15px;
    line-height: 1.5;
}

.legal-notice a {
    color: #56949f;
    text-decoration: none;
}

.legal-notice a:hover {
    text-decoration: underline;
}

/* === STATS MODAL === */
.stats-modal {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.stats-modal-body {
    margin-bottom: 0;
}

.stats-section {
    margin-bottom: 30px;
}

.stats-section:last-child {
    margin-bottom: 0;
}

.stats-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #575279;
    font-weight: bold;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #f2e9e1;
    padding: 20px;
    text-align: center;
    border: 2px solid #cecacd;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #575279;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Chart */
#progressChart {
    max-height: 300px;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .app-title {
        font-size: 1.8rem;
    }

    .week-label {
        font-size: 0.9rem;
        min-width: auto;
    }

    .toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: 100%;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .header {
        padding: 15px 10px;
        margin-bottom: 15px;
    }

    .main-content {
        padding: 15px 10px;
    }

    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .auth-section {
        flex-direction: row;
        font-size: 0.85rem;
    }

    .task-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 8px;
        gap: 12px;
    }

    .task-name-cell {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .task-icon {
        font-size: 1.3rem;
    }

    .task-name {
        font-size: 0.95rem;
        flex: 1;
        min-width: 0;
    }

    .task-delete-btn {
        font-size: 1.5rem;
        padding: 0 5px;
    }

    .task-days-grid {
        width: 100%;
        gap: 4px;
    }

    .week-header {
        flex-direction: column;
        gap: 8px;
        padding-bottom: 8px;
        margin-bottom: 15px;
    }

    .task-name-column {
        width: 100%;
        font-size: 0.9rem;
    }

    .days-grid {
        width: 100%;
        gap: 4px;
    }

    .day-header {
        font-size: 0.75rem;
    }

    .day-cell {
        min-width: 38px;
        width: 100%;
        height: 38px;
        font-size: 1rem;
        border-width: 1.5px;
    }
    .home-hero {
        flex-direction: column;
        padding: 20px;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .hero-text p {
        font-size: 1rem;
    }

    .hero-image img {
        max-width: 100%;
        height: auto;
    }

    .features {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }

    .feature-card {
        padding: 20px;
    }

    .week-navigation {
        gap: 10px;
    }

    .btn-week-nav {
        min-width: 44px;
        height: 44px;
        padding: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn {
        font-size: 0.9rem;
        padding: 10px 16px;
        min-height: 44px;
    }

    .modal {
        width: 95%;
        padding: 15px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .icon-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .icon-option {
        width: 100%;
        height: 55px;
    }

    .oauth-buttons .btn {
        min-width: 100%;
    }
    
    .stats-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}