/* Critical CSS for App Pages - Prevents layout shift */

/* Base reset to prevent margin collapse */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Essential body styles */
html, body {
    height: 100%;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: #f5f5f3;
    color: #333;
    line-height: 1.5;
}

/* Fixed header - prevent content jump */
.page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: rgb(255 255 255 / 95%);
    box-shadow: 0 2px 10px rgb(0 0 0 / 10%);
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e0e0e0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 100%;
}

/* Main content spacing */
main {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* Hide theme toggle until JS loads */
#theme-toggle-btn {
    opacity: 0;
    transition: opacity 0.3s ease;
    width: 56px;
    height: 28px;
}

/* Essential app container styles */
.coffee-app-container,
.water-app-container,
.sleep-app-container,
.exercise-app-container,
.data-app-container,
.notes-app-container,
.reader-app-container,
.quotes-app-container,
.jokes-app-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* App banner - prevent shift */
.app-banner {
    background: linear-gradient(135deg, #6f4e37 0%, #8b6f47 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

/* Tab navigation - prevent layout shift */
.tab-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    min-height: 48px;
}

/* Form elements - consistent sizing */
input, textarea, select, button {
    font-family: inherit;
    font-size: 16px;
}

/* Buttons - prevent shift */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* Skip link accessibility */
.skip-to-content {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-to-content:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    width: auto;
    height: auto;
    padding: 12px 24px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-container {
        padding: 12px 16px;
    }
    
    .coffee-app-container,
    .water-app-container,
    .sleep-app-container,
    .exercise-app-container,
    .data-app-container,
    .notes-app-container,
    .reader-app-container,
    .quotes-app-container,
    .jokes-app-container {
        padding: 16px;
    }
}