/* Common CSS Styles for Spiritual Wellness Web App */
/* Mobile-first design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #338BFF;
    --primary-light-blue: #51C7FE;
    --primary-purple: #905DFF;
    --light-purple: #B18DFF;
    --background: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-light: #F0F0F0;
    --background-gray: #F5F8FA;
    --background-light-gray: #F8F9FA;
    --card-border: #E5E5E5;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background: var(--background);
    min-height: 100vh;
    position: relative;
    padding-top: 60px;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--background-gray);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.header-left,
.header-right {
    width: 70px;
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: flex-start;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-logo {
    width: 28px;
    height: 28px;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

.back-btn,
.notification-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #E8E8E8;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.back-btn:hover,
.notification-btn:hover {
    background: #D0D0D0;
}

/* Button Styles */
button {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

button:active {
    transform: scale(0.98);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Modal */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-modal.hidden {
    display: none;
}

.loading-modal-content {
    background: var(--background);
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    max-width: 320px;
    margin: 0 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.loading-animation {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.loading-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.loading-modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.gradient-text {
    background: linear-gradient(90deg, var(--primary-purple), var(--light-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 380px) {
    .header-title {
        font-size: 16px;
    }
    
    .header-logo {
        width: 24px;
        height: 24px;
    }
}

/* Safe area handling for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .container {
        padding-bottom: env(safe-area-inset-bottom);
    }
}