/* Custom variables & Theme Settings */
:root {
    --bg-primary: #f6faf7;
    --bg-card: #ffffff;
    --bg-utility: rgba(255, 255, 255, 0.85);
    --border-color: #e3ede7;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    --brand-mint: #8cd3a8;
    --brand-mint-hover: #76c093;
    --brand-mint-light: #edf7f2;
    --brand-mint-border: #cde6d8;
    
    --brand-teal: #438a7c;
    --brand-teal-light: #eaf5f2;
    
    --alert-coral: #e76f51;
    --alert-coral-hover: #f4a261;
    --alert-coral-light: #fef5f2;
    --alert-coral-text: #b84326;
    --alert-coral-border: #f8d3c9;
    
    --danger-red: #d9534f;
    --danger-red-hover: #c9302c;
    
    --shadow-sm: 0 2px 4px rgba(12, 26, 18, 0.04);
    --shadow-md: 0 10px 20px -8px rgba(12, 26, 18, 0.08);
    --shadow-lg: 0 20px 40px -15px rgba(12, 26, 18, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: all 0.15s ease;
    --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    --container-max-width: 820px;
}

/* Dark Mode Overrides */
body.dark-theme {
    --bg-primary: #101512;
    --bg-card: #181e1a;
    --bg-utility: rgba(24, 30, 26, 0.85);
    --border-color: #27312b;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    --brand-mint: #8cd3a8;
    --brand-mint-hover: #a1dfbb;
    --brand-mint-light: #1c2721;
    --brand-mint-border: #2c3f35;
    
    --brand-teal: #5bb3a2;
    --brand-teal-light: #162521;
    
    --alert-coral: #f4a261;
    --alert-coral-hover: #f6b27e;
    --alert-coral-light: #2b1f17;
    --alert-coral-text: #ffbfa0;
    --alert-coral-border: #442f24;
    
    --danger-red: #e76c68;
    --danger-red-hover: #f18c88;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 20px -8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-mint);
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Dynamic Entrance Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Utility Bar */
.utility-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-utility);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.utility-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Main Container Layout */
.main-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 24px 24px 60px 24px;
    animation: fadeIn 0.8s ease-out;
}

/* Header & Brand Logo */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 40px;
}

.logo-wrapper {
    background: transparent;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

/* Logo inversion / styling for dark mode */
.brand-logo {
    max-width: 100%;
    height: auto;
    width: 320px;
    display: block;
    object-fit: contain;
    transition: filter var(--transition-normal);
}

body.dark-theme .brand-logo {
    /* Slight brightness increase for better visibility on dark backgrounds, or full inversion if needed.
       Since the logo background is white, let's keep it visible, but we can apply a filter if it looks better, or style the container */
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15)) brightness(1.05);
}

.header-divider {
    width: 80px;
    height: 3px;
    background: var(--brand-mint);
    border-radius: var(--radius-full);
    margin-top: 30px;
}

/* Cards System */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Hero Notice Card specific */
.hero-card {
    border-top: 4px solid var(--brand-mint);
    animation-delay: 0.1s;
    text-align: center;
}

.status-badge {
    display: inline-block;
    background-color: var(--brand-mint-light);
    color: var(--brand-teal);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
    border: 1px solid var(--brand-mint-border);
}

.hero-card h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.highlight-text {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.7;
}

.hero-card p {
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 16px auto;
}

.hero-card p:last-child {
    margin-bottom: 0;
}

/* Info Grid Layout (GP & Urgent Care + Medical Emergency) */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.info-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.info-card h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.info-card p:last-of-type {
    margin-bottom: 0;
}

.info-card:first-child {
    animation-delay: 0.2s;
}

.info-card:last-child {
    animation-delay: 0.3s;
}

/* Icons */
.card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.card-icon {
    width: 24px;
    height: 24px;
}

.mint-bg {
    background-color: var(--brand-mint-light);
    color: var(--brand-teal);
    border: 1px solid var(--brand-mint-border);
}

.coral-bg {
    background-color: var(--alert-coral-light);
    color: var(--alert-coral-text);
    border: 1px solid var(--alert-coral-border);
}

.teal-bg {
    background-color: var(--brand-teal-light);
    color: var(--brand-teal);
    border: 1px solid var(--border-color);
}

/* Medical Emergency Card Specific */
.alert-card {
    border-top: 4px solid var(--alert-coral);
}

.text-coral {
    color: var(--alert-coral-text) !important;
}

.emergency-action {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.emergency-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.emergency-number {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--alert-coral-text);
    line-height: 1.1;
    margin: 4px 0 8px 0;
    text-decoration: none;
    transition: var(--transition-fast);
}

.emergency-number:hover {
    color: var(--alert-coral);
    transform: scale(1.03);
}

.emergency-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mental Health Section */
.mental-health-section {
    animation-delay: 0.4s;
}

.section-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Contacts List Rows */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-row {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: var(--transition-normal);
}

.contact-row:hover {
    border-color: var(--brand-mint);
    transform: translateX(4px);
}

.row-danger {
    border-left: 4px solid var(--danger-red);
}

.row-danger:hover {
    border-color: var(--danger-red) var(--border-color) var(--border-color) var(--danger-red);
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.contact-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.contact-links {
    margin-top: 8px;
}

.text-link {
    color: var(--brand-teal);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border-bottom: 1px solid transparent;
}

.text-link:hover {
    color: var(--brand-mint-hover);
    border-bottom: 1px solid var(--brand-mint);
}

.contact-action {
    display: flex;
    align-items: center;
}

/* Button & Tooltip System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--brand-teal);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--brand-mint-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 138, 124, 0.15);
}

body.dark-theme .btn-primary {
    background-color: var(--brand-mint);
    color: #101512;
}

body.dark-theme .btn-primary:hover {
    background-color: var(--brand-mint-hover);
    box-shadow: 0 4px 12px rgba(140, 211, 168, 0.25);
}

.btn-secondary {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--brand-mint);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.btn-danger {
    background-color: var(--danger-red);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: var(--danger-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 83, 79, 0.2);
}

.btn-icon-only {
    padding: 10px;
    border-radius: var(--radius-md);
}

.btn-group {
    display: inline-flex;
    gap: 8px;
    position: relative;
}

.icon {
    width: 18px;
    height: 18px;
}

.copy-icon {
    width: 16px;
    height: 16px;
}

/* Copy Button Specific Style & Tooltip */
.copy-btn {
    position: relative;
    padding: 10px;
}

.copy-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: #1e293b;
    color: #ffffff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
    z-index: 10;
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.copy-btn:hover .copy-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Sun/Moon Toggle Theme Animations */
.icon-moon {
    display: block;
}
.icon-sun {
    display: none;
}

body.dark-theme .icon-moon {
    display: none;
}
body.dark-theme .icon-sun {
    display: block;
}

/* Footer Section */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 1s ease-out both;
    animation-delay: 0.5s;
}

.appreciation {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 20px;
}

.signature {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.signature strong {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Toast Success Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--brand-teal);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    z-index: 1000;
}

body.dark-theme .toast {
    background-color: var(--brand-mint);
    color: #101512;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hero-card h1 {
        font-size: 1.8rem;
    }
    
    .contact-row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 18px 20px;
    }
    
    .contact-action {
        justify-content: flex-start;
    }
    
    .btn-group {
        display: flex;
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
    
    .btn-group .copy-btn {
        flex: 0 0 auto;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    .main-container {
        padding: 16px 16px 40px 16px;
    }
    
    .card {
        padding: 24px 16px;
    }
    
    .hero-card h1 {
        font-size: 1.5rem;
    }
    
    .emergency-number {
        font-size: 2.2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Print Stylesheet */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
        line-height: 1.5;
        padding-bottom: 0;
    }
    
    .utility-bar,
    .copy-btn,
    .copy-tooltip,
    .btn,
    #toast,
    .header-divider,
    .card-icon-wrapper,
    .status-badge {
        display: none !important;
    }
    
    .main-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 24pt !important;
        background-color: transparent !important;
    }
    
    .hero-card h1 {
        font-size: 22pt;
        text-align: left;
        margin-bottom: 12pt;
    }
    
    .highlight-text {
        font-size: 13pt;
        font-weight: bold;
    }
    
    .info-grid {
        display: block;
    }
    
    .info-card {
        margin-bottom: 18pt !important;
        page-break-inside: avoid;
    }
    
    .emergency-action {
        border-top: none;
        padding-top: 0;
    }
    
    .emergency-number {
        font-size: 24pt !important;
        font-weight: bold;
        color: #000000 !important;
        margin: 4pt 0;
    }
    
    .mental-health-section h2 {
        font-size: 16pt;
        margin-bottom: 6pt;
    }
    
    .contact-list {
        gap: 12pt;
    }
    
    .contact-row {
        background-color: transparent !important;
        border: none !important;
        border-bottom: 1px solid #cccccc !important;
        border-radius: 0 !important;
        padding: 8pt 0 !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        page-break-inside: avoid;
    }
    
    .contact-info {
        flex: 1;
    }
    
    .contact-name {
        font-size: 11pt;
        font-weight: bold;
    }
    
    .contact-action {
        display: block !important;
        text-align: right;
    }
    
    /* Write out phone numbers clearly for printing since call buttons disappear */
    .contact-action::after {
        content: attr(data-print-number);
        font-weight: bold;
        font-size: 11pt;
    }
    
    .row-danger {
        border-left: none !important;
    }
    
    .footer {
        border-top: 1px solid #cccccc !important;
        margin-top: 30pt !important;
        padding-top: 12pt !important;
        text-align: left !important;
        page-break-inside: avoid;
    }
    
    .signature {
        margin-bottom: 0;
    }
    
    a {
        text-decoration: underline !important;
        color: #000000 !important;
    }
}
