/* Global Styles - Shared across all pages */

/* Base Layout */
body {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5f7b 25%, #1a2a3a 75%, #0f1419 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.btn-add-historical-entry {
    margin-top: 15px !important;
}

#btn-save-profile {
    min-width:120px !important;
}

#btn-add-entry {
    min-width:120px !important;
}

#btn-logout {
    min-width:120px !important;
}

/* Glass Morphism Components */
.glass-card {
    background: rgba(30, 58, 95, 0.4);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(100, 150, 200, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
}

.glass-input {
    background: rgba(20, 40, 60, 0.6);
    border: 1px solid rgba(100, 150, 200, 0.3);
    border-radius: 10px;
    color: white;
    padding: 12px 16px;
    font-size: 0.9rem;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.glass-input:focus {
    background: rgba(30, 50, 70, 0.8);
    border-color: rgba(100, 166, 216, 0.6);
    box-shadow: 0 0 0 0.2rem rgba(100, 166, 216, 0.2);
    color: white;
}

/* Time input styling */
input[type="time"] {
    color: white !important;
}

/* Time picker icon */
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input[type="time"]::-webkit-datetime-edit-text {
    color: white;
}

input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field {
    color: white;
}

/* NOTE: Checkbox styling moved to individual theme files for better theming */

/* Logo Components */
.logo-icon {
    background: rgba(100, 150, 200, 0.3);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64a6d8;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
}

.logo-text {
    color: #879cab;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0;
}

/* Logo Animations */
.progress-ring {
    animation: rotate 4s linear infinite;
}

.progress-ring-circle {
    stroke-dasharray: 94;
    stroke-dashoffset: 94;
    animation: progress 4s ease-in-out infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes progress {
    0% {
        stroke-dashoffset: 94;
    }
    50% {
        stroke-dashoffset: 23.5;
    }
    100% {
        stroke-dashoffset: 94;
    }
}

/* Button Styles */
.primary-btn {
    background: #64a6d8;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    padding: 12px;
    transition: all 0.3s ease;
}

.primary-btn:hover:not(:disabled) {
    background: #5294c4;
    transform: translateY(-1px);
    color: white;
}

.primary-btn:disabled {
    background: rgba(100, 150, 200, 0.3);
    color: rgba(255, 255, 255, 0.4);
}

/* Coffee Button */
.coffee-btn {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 50%, #CD853F 100%);
    border: 1px solid rgba(139, 69, 19, 0.6);
    border-radius: 10px;
    color: white;
    font-weight: 600;
    padding: 8px 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
}

.coffee-btn:hover {
    background: linear-gradient(135deg, #A0522D 0%, #FF8C00 50%, #DEB887 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
    color: white;
    text-decoration: none;
}

.coffee-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(139, 69, 19, 0.2);
}

/* Save Settings Button */
#btn-save-settings {
    min-width: 150px;
    width: auto;
}

/* Navigation Layout Fixes */
.nav-item.flex-fill {
    flex: 1 1 0%;
    min-width: 0;
}

.nav-tabs .nav-item.flex-fill .nav-link {
    font-size: 0.8rem;
}

/* Ensure tabs stay on one row */
.nav-tabs.d-flex {
    flex-wrap: nowrap !important;
}

/* Responsive navigation adjustments */
@media (max-width: 768px) {
    .nav-item.flex-fill .nav-link {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }

    .nav-item.flex-fill .tab-icon {
        display: block;
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }
}

@media (max-width: 576px) {
    .nav-item.flex-fill .nav-link {
        padding: 0.4rem 0.2rem;
        font-size: 0.7rem;
    }

    .nav-item.flex-fill .tab-icon {
        font-size: 0.9rem;
    }
}

/* Navigation Tabs */
.nav-tabs {
    border: none;
    justify-content: center;
    margin-bottom: 2rem;
}

.nav-tabs .nav-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
    background: rgba(100, 150, 200, 0.3);
    color: white;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: white;
    background: rgba(100, 150, 200, 0.2);
}

/* Form Elements */
.form-check-label {
    color: rgba(255, 255, 255, 0.8);
}

.form-check-label a {
    color: #64a6d8;
}

/* Alert System */
#alert-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 320px;
    max-width: 500px;
    width: auto;
}

#alert-container .alert {
    margin-bottom: 0;
    backdrop-filter: blur(10px);
    background: rgba(30, 58, 95, 0.95) !important;
    border: 1px solid rgba(100, 150, 200, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: white !important;
}

#alert-container .alert-success {
    background: rgba(40, 80, 40, 0.95) !important;
    border-color: rgba(100, 200, 100, 0.3);
    color: white !important;
}

#alert-container .alert-danger {
    background: rgba(80, 40, 40, 0.95) !important;
    border-color: rgba(200, 100, 100, 0.3);
    color: white !important;
}

#alert-container .alert-info {
    background: rgba(30, 58, 95, 0.95) !important;
    border-color: rgba(100, 150, 200, 0.3);
    color: white !important;
}

#alert-container .alert .close {
    color: rgba(255, 255, 255, 0.8) !important;
    opacity: 0.8;
}

#alert-container .alert .close:hover {
    color: white !important;
    opacity: 1;
}

/* Text Colors */
.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Link Colors */
.btn-link {
    color: #64a6d8;
}

.btn-link:hover {
    color: #5294c4;
}

.text-info {
    color: #64a6d8 !important;
}

.text-success {
    color: #7bc96f !important;
}

.text-danger {
    color: #e85d75 !important;
}

/* ===== RESPONSIVE DESIGN MEDIA QUERIES ===== */

/* Large Tablets and Small Desktops (768px - 1024px) */
@media (max-width: 1024px) {
    .glass-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    #alert-container {
        left: 50%;
        transform: translateX(-50%);
        min-width: 280px;
        max-width: calc(100vw - 40px);
        margin: 0 20px;
    }
}


/* Extra Small Mobile Devices (770px and below) - iPhone SE optimized */
@media (max-width: 775px) {
    body {
        padding: 2px;
    }

    .glass-card {
        padding: 0.6rem;
        margin-bottom: 0.6rem;
        max-width: calc(100vw - 8px);
        border-radius: 10px;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
    }

    .logo-icon svg {
        width: 16px;
        height: 16px;
    }

    .logo-text {
        font-size: 0.55rem;
        line-height: 1.1;
    }

    .glass-input {
        padding: 6px 10px!important;
        font-size: 16px;
        min-height: 36px;
        border-radius: 6px;
    }

    .primary-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-height: 36px;
        border-radius: 6px;
    }

    .nav-tabs {
        flex-wrap: wrap;
        margin-bottom: 0.8rem;
    }

    .nav-tabs .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        margin: 0.02rem;
        border-radius: 8px;
        min-width: auto;
        flex: 1;
        text-align: center;
    }

    /* Alert container improvements for iPhone SE */
    #alert-container {
        left: 2px;
        right: 2px;
        transform: none;
        min-width: auto;
        max-width: calc(100vw - 4px);
        top: 5px;
    }

    #alert-container .alert {
        font-size: 0.8rem;
        padding: 0.5rem;
        border-radius: 6px;
    }
}

/* Landscape Mobile Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .glass-card {
        padding: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
    }

    .logo-icon svg {
        width: 16px;
        height: 16px;
    }

    .nav-tabs {
        margin-bottom: 0.8rem;
    }

    .nav-tabs .nav-link {
        padding: 0.3rem 0.8rem;
    }
}

/* ===== BODY INSIGHTS CARD STYLING ===== */

/* Collapsible card header */
.card-header-collapsible {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 1rem;
}

.card-header-collapsible:hover {
    opacity: 0.8;
}

.card-toggle {
    font-size: 2rem !important;
    font-weight: 300;
    color: #ffffff;
    margin-left: 1rem;
    line-height: 1;
    min-width: 25px;
    text-align: center;
}

.collapsible-content {
    overflow: hidden;
}

/* Insights content */
.insights-content {
    line-height: 1.6;
}

.insight-item {
    padding: 0.75rem;
    border-left: 3px solid rgba(123, 97, 255, 0.5);
    background: rgba(123, 97, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.insight-item:hover {
    background: rgba(123, 97, 255, 0.1);
    border-left-color: rgba(123, 97, 255, 0.8);
}

.insight-item:last-child {
    margin-bottom: 0 !important;
}

.insight-title {
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.insight-description {
    font-size: 0.9rem;
    color: #bbbbbb;
    margin: 0;
}

/* Mobile responsive adjustments for insights */
@media (max-width: 775px) {
    .card-header-collapsible {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .card-toggle {
        font-size: 1.3rem;
    }

    .insight-item {
        padding: 0.5rem;
    }

    .insight-title {
        font-size: 0.9rem;
    }

    .insight-description {
        font-size: 0.85rem;
    }
}

/* ===== FINAL OVERRIDES - Must be at end of file ===== */

/* NOTE: Checkbox styling moved to individual theme files for better theming */