/* Sunlight App Clean CSS - Only Used Styles */

/* =============================================================================
   BASE STYLES
   ============================================================================= */

.sunlight-app-page {
    background-color: #fff;
    font-family: Inter, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* =============================================================================
   APP CONTAINER & LAYOUT
   ============================================================================= */

.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fffef5;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;

    /* Flexbox layout fixes */
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px); /* Account for header height */
}

/* =============================================================================
   APP HEADER
   ============================================================================= */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: linear-gradient(to right, #fff9e5, #fffef5);
    border-radius: 10px;
    border: 1px solid rgb(255 160 0 / 20%);
}

.date-display {
    font-size: 18px;
    color: #e65100;
    font-weight: 600;
}

.shortcuts-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.shortcuts-toggle:hover {
    background-color: rgb(255 160 0 / 10%);
}

/* Keyboard Shortcuts Help */
.shortcuts-help {
    background: #fff9e5;
    border: 1px solid rgb(255 160 0 / 30%);
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 5px 0;
}

.shortcuts-help kbd {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: monospace;
    font-size: 12px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}

/* =============================================================================
   SUN STATUS SECTION
   ============================================================================= */

.sun-status {
    background-color: #fffaf0;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 15px;
    text-align: center;
    border: 2px solid rgb(255 160 0 / 30%);
    overflow: hidden;
}

.sun-status p {
    margin: 10px 0 0 0;
    font-size: 18px;
    color: #5a4a42;
    font-weight: 500;
}

.status-icon {
    font-size: 56px;
    display: block;
    transition: transform 0.3s ease-in-out;
}

/* Sun to checkmark animation */
@keyframes sun-to-checkmark {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    5% {
        transform: scale(1.1) translateY(0);
        opacity: 0.9;
    }
    15% {
        transform: scale(1.2) translateY(-10px);
        opacity: 0.7;
    }
    25% {
        transform: scale(1.3) translateY(-15px);
        opacity: 0.4;
    }
    35% {
        transform: scale(1.4) translateY(-20px);
        opacity: 0.1;
    }
    45% {
        transform: scale(0);
        opacity: 0;
    }
    65% {
        transform: scale(0.7);
        opacity: 1;
    }
    85% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.sun-animation {
    animation: sun-to-checkmark 1s ease-in-out;
    will-change: transform, opacity;
    transform-origin: center center;
}

/* =============================================================================
   STREAK DISPLAY
   ============================================================================= */

.streak-container {
    text-align: center;
    margin-bottom: 15px;
}

.streak-display {
    display: inline-block;
    background: linear-gradient(135deg, #ff9800, #ff6f00);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgb(255 111 0 / 30%);
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.button-container {
    text-align: center;
    margin-bottom: 20px;
}

.sunlight-app-page .btn-primary {
    background-color: #ffa000;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 20px 40px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.15s;
    box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
    min-height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 280px;
}

.sunlight-app-page .btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
    background-color: #ff8f00;
}

.sunlight-app-page .btn-primary:hover {
    background-color: #ff8f00;
}

.sunlight-app-page .btn-primary:disabled,
.sunlight-app-page .btn-primary.logged {
    background-color: #4caf50;
    cursor: not-allowed;
}

.sunlight-app-page .btn-primary:focus-visible {
    outline: 3px solid #ff6f00;
    outline-offset: 2px;
}

.undo-link {
    display: block;
    margin-top: 10px;
    color: #ff6f00;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s;
}

.undo-link:hover {
    text-decoration: underline;
}

/* =============================================================================
   WEEK VIEW
   ============================================================================= */

.week-view {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgb(255 160 0 / 20%);
}

.week-days {
    display: flex;
    justify-content: space-around;
    gap: 5px;
}

.week-day {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    border-radius: 8px;
    background: #f9f9f9;
    transition: background-color 0.2s;
}

.week-day.today {
    background: #fff9e5;
    border: 2px solid rgb(255 160 0 / 40%);
    padding: 8px 3px;
}

.week-day.logged {
    background: #e8f5e9;
}

.week-day.logged.today {
    background: linear-gradient(135deg, #e8f5e9, #fff9e5);
}

.day-name {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.day-indicator {
    font-size: 20px;
    color: #4caf50;
}

.week-day:not(.logged) .day-indicator {
    color: #ccc;
}

/* =============================================================================
   BACK BUTTON CONTAINER
   ============================================================================= */

.back-button-container {
    text-align: center;
    margin-top: auto;
    padding: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.sunlight-app-page .btn-link {
    background: none;
    color: #ff6f00;
    border: none;
    box-shadow: none;
    padding: 10px 15px;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s;
}

.sunlight-app-page .btn-link:hover {
    color: #e65100;
    background: none;
    text-decoration: underline;
}

/* =============================================================================
   MODAL STYLES
   ============================================================================= */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 50%);
    z-index: 1500;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgb(0 0 0 / 10%);
    border-top: 6px solid #ffa000;
    margin: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content.modal-remove {
    border-top: 6px solid #f44336;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffa000;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.modal-remove .modal-title {
    color: #f44336;
}

.modal-icon {
    font-size: 24px;
    margin-right: 10px;
}

.modal-message {
    margin-bottom: 20px;
    color: #221815;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
}

.modal-btn-cancel {
    background-color: #f5f5f5;
    color: #3E2723;
    border: 1px solid #ddd;
}

.modal-btn-confirm {
    background-color: #ffa000;
    color: white;
    border: none;
}

.modal-remove .modal-btn-confirm {
    background-color: #f44336;
}

.modal-btn:focus-visible {
    outline: 3px solid #ff6f00;
    outline-offset: 2px;
}

/* =============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================= */

/* Mobile responsive adjustments */
@media (width <= 768px) {
    .app-container {
        position: relative !important;
        inset: auto !important;
        height: auto !important;
        max-width: 500px !important;
    }
    
    .sunlight-app-page .btn {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        margin-bottom: 10px !important;
    }
}

/* Small mobile screens */
@media (width < 500px) {
    .app-container {
        padding: 15px;
    }

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

    .date-display {
        font-size: 16px;
    }

    .sun-status {
        padding: 15px;
    }

    .status-icon {
        font-size: 48px;
    }

    .sun-status p {
        font-size: 16px;
    }

    .sunlight-app-page .btn-primary {
        min-width: 240px;
        padding: 18px 30px;
        font-size: 18px;
    }

    .week-view {
        padding: 12px;
    }

    .day-name {
        font-size: 11px;
    }

    .day-indicator {
        font-size: 18px;
    }

    .modal-content {
        margin: 10px;
        padding: 18px;
    }
}

/* Very small screens */
@media (width <= 400px) {
    .date-display {
        font-size: 14px;
    }

    .shortcuts-toggle {
        font-size: 18px;
        padding: 4px 8px;
    }
}

@media (width <= 350px) {
    .sun-status p {
        font-size: 14px;
    }

    .sunlight-app-page .btn-primary {
        min-width: 200px;
        font-size: 16px;
    }
}

/* Tablet/desktop responsive */
@media (width <= 640px) {
    .app-container {
        border-radius: 0;
    }
    
    body {
        margin: 0;
        padding: 0;
    }
    
    main {
        padding: 0;
    }
}

/* Medium viewports - consistent button size */
@media (width >= 500px) and (width <= 1000px) {
    .app-container {
        max-width: 450px;
        padding: 20px;
    }
    
    .sun-status {
        padding: 20px;
    }
    
    .button-group {
        margin-bottom: 15px;
    }
}

/* Large desktop screens - compact layout */
@media (width >= 1600px) and (height <= 900px) {
    body {
        display: flex;
        flex-direction: column;
    }
    
    main {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 0;
    }
    
    .app-container {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        padding: 15px 20px;
    }
    
    .app-header {
        margin-bottom: 15px;
        padding: 10px 0;
    }
    
    .sun-status {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .sun-status h2 {
        font-size: 1.3rem;
        margin: 0.3rem 0;
    }
    
    .status-icon {
        font-size: 40px;
        margin-bottom: 5px;
    }
}