/* =========================================
   1. MODERN DESIGN SYSTEM & VARIABLES
   ========================================= */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Sober Health Colors */
    --bg-body: #f8fafc;       /* Very light slate */
    --bg-card: #ffffff;
    --text-main: #1e293b;     /* Dark slate */
    --text-muted: #64748b;    /* Medium slate */
    --border: #e2e8f0;
    
    /* Shadows & Radius */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; font-weight: 500; transition: color 0.2s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* =========================================
   2. LAYOUT & NAVIGATION
   ========================================= */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.navbar-link {
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.navbar-link:hover {
    background: #f1f5f9;
    color: var(--text-main);
    text-decoration: none;
}

.navbar-link.active {
    background: #eef2ff;
    color: var(--primary);
}

.main-content {
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================================
   3. HOMEPAGE SECTIONS
   ========================================= */
.hero-section {
    background: var(--gradient);
    color: white;
    padding: 80px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 32px;
    font-weight: 400;
}

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 48px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Grids */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
    align-items: center;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    display: inline-block;
    background: #eef2ff;
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border-radius: 12px;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-main);
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* =========================================
   4. BUTTONS & FORMS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

/* =========================================
   5. OFFICIAL GOOGLE SIGN-IN BUTTON
   (Adapted to Propsy Health Design)
   ========================================= */

/* Ensure <a> tags work as buttons */
a.gsi-material-button { 
    text-decoration: none; 
    display: inline-flex;
    align-items: center;
}

.gsi-material-button {
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-appearance: none;
    background: white;
    background-image: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    color: var(--text-main);
    cursor: pointer;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    height: 44px;
    letter-spacing: 0.25px;
    outline: none;
    overflow: hidden;
    padding: 0 20px;
    position: relative;
    text-align: center;
    transition: all 0.2s ease;
    vertical-align: middle;
    white-space: nowrap;
    width: auto;
    max-width: 400px;
    min-width: 200px;
    box-shadow: var(--shadow-sm);
}

.gsi-material-button .gsi-material-button-icon {
    height: 20px;
    margin-right: 12px;
    min-width: 20px;
    width: 20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100%;
    justify-content: center;
    position: relative;
    width: 100%;
}

.gsi-material-button .gsi-material-button-contents {
    flex-grow: 1;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
    color: var(--text-main);
}

.gsi-material-button .gsi-material-button-state {
    transition: opacity 0.2s ease;
    bottom: 0;
    left: 0;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
    background-color: rgba(102, 126, 234, 0.08);
    border-radius: 8px;
}

/* Hover state - Purple tint */
.gsi-material-button:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.gsi-material-button:hover .gsi-material-button-state {
    opacity: 1;
    background-color: rgba(102, 126, 234, 0.08);
}

/* Active/Pressed state */
.gsi-material-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.gsi-material-button:active .gsi-material-button-state {
    background-color: rgba(102, 126, 234, 0.12);
    opacity: 1;
}

/* Focus state for accessibility */
.gsi-material-button:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Disabled state */
.gsi-material-button:disabled {
    cursor: not-allowed;
    background-color: #f1f5f9;
    border-color: var(--border);
    opacity: 0.6;
}

.gsi-material-button:disabled .gsi-material-button-contents {
    opacity: 0.6;
}

.gsi-material-button:disabled .gsi-material-button-icon {
    opacity: 0.6;
}

/* Navbar version - smaller */
.gsi-navbar {
    height: 38px;
    font-size: 13px;
    padding: 0 14px;
    min-width: 160px;
}

.gsi-navbar .gsi-material-button-icon {
    height: 18px;
    width: 18px;
    margin-right: 8px;
}

.gsi-navbar .gsi-material-button-contents {
    font-size: 13px;
}

/* Hero section version - larger */
.hero-section .gsi-material-button {
    height: 50px;
    font-size: 16px;
    padding: 0 28px;
    min-width: 240px;
    font-weight: 600;
}

.hero-section .gsi-material-button .gsi-material-button-icon {
    height: 22px;
    width: 22px;
    margin-right: 14px;
}

.hero-section .gsi-material-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

/* =========================================
   6. FOOTER & UTILITIES
   ========================================= */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

.footer-links { margin-top: 16px; display: flex; justify-content: center; gap: 24px; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .navbar-menu { display: none; } /* Add hamburger logic if needed */
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* =========================================
   7. DASHBOARD SPECIFIC STYLES
   ========================================= */

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}