/* ================================
   BASE STYLES & VARIABLES
   ================================ */

:root {
    --primary-color: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #e6f0ff;
    --secondary-color: #34a853;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --white: #ffffff;
    --black: #000000;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
   TYPOGRAPHY
   ================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

h5 {
    font-size: 1.1rem;
    font-weight: 600;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

ul, ol {
    list-style: none;
}

/* ================================
   LAYOUT UTILITIES
   ================================ */

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

.section {
    padding: 4rem 0;
}

.section-sm {
    padding: 2rem 0;
}

.section-lg {
    padding: 6rem 0;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }

.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }

/* ================================
   HEADER & NAVIGATION
   ================================ */

.header {
    --nav-height: 70px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-lg);
    padding: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-height);
    padding: 0;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
    color: inherit;
    text-decoration: none;
    border-radius: 12px;
}

.logo:hover {
    text-decoration: none;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.logo-image {
    display: block;
    width: auto;
    height: calc(var(--nav-height) - 0.2cm);
    max-height: calc(var(--nav-height) - 0.2cm);
    object-fit: contain;
    object-position: left center;
    max-width: none;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.logo-text {
    color: var(--dark-color);
    font-family: 'Poppins', sans-serif;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-dropdown-icon {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-icon,
.nav-dropdown:focus-within .nav-dropdown-icon,
.nav-dropdown.open .nav-dropdown-icon {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: 0.35rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-dropdown-item {
    display: block;
    padding: 0.55rem 0.85rem;
    color: var(--text-color);
    font-size: 0.92rem;
    border-bottom: 1px solid var(--gray-200);
    text-decoration: none;
}

.nav-dropdown-item:last-child {
    border-bottom: none;
}

.nav-dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.admin-link {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link.admin-link:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.nav-link.admin-link::after {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 2px;
    transition: var(--transition);
}

/* ================================
   ALERTS & MESSAGES
   ================================ */

.alert {
    padding: 1rem;
    margin-bottom: 0;
    border-left: 4px solid;
    position: relative;
    margin-top: 60px;
}

.alert-success {
    background-color: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: var(--info-color);
    color: #0c5460;
}

.alert-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

/* ================================
   MAIN CONTENT
   ================================ */

.main-content {
    margin-top: 70px;
    min-height: calc(100vh - 250px);
}

/* ================================
   BUTTONS
   ================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #2d8e47;
    text-decoration: none;
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
    text-decoration: none;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
    text-decoration: none;
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ================================
   FORMS
   ================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
}

.form-error {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.form-error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ================================
   CARDS
   ================================ */

.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-header {
    padding: 1.5rem;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ================================
   GRID SYSTEM
   ================================ */

.row {
    display: grid;
    gap: 2rem;
}

.col-1 { grid-template-columns: repeat(1, 1fr); }
.col-2 { grid-template-columns: repeat(2, 1fr); }
.col-3 { grid-template-columns: repeat(3, 1fr); }
.col-4 { grid-template-columns: repeat(4, 1fr); }
.col-5 { grid-template-columns: repeat(5, 1fr); }
.col-6 { grid-template-columns: repeat(6, 1fr); }

/* ================================
   FOOTER
   ================================ */

.footer {
    background: var(--dark-color);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-section p {
    color: #bbb;
    margin-bottom: 0.5rem;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bbb;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-contact-actions {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.55rem;
    max-width: 260px;
}

.footer-contact-btn {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 8px;
    padding: 0.62rem 0.8rem;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.footer-contact-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 120%;
    height: 100%;
    background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.24) 50%, transparent 100%);
    transition: left 0.35s ease;
}

.footer-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
    filter: brightness(1.04);
}

.footer-contact-btn:hover::after {
    left: 100%;
}

.footer-contact-btn:active {
    transform: translateY(0);
}

.footer-contact-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.footer-contact-btn-emergency {
    background: linear-gradient(135deg, #cf2f2f 0%, #b11f1f 100%);
}

.footer-contact-btn-care {
    background: linear-gradient(135deg, #0f66c2 0%, #0b4f97 100%);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bbb;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (min-width: 1281px) {
    .container {
        max-width: 1280px;
        padding: 0 30px;
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    .container {
        max-width: 1160px;
        padding: 0 24px;
    }

    .nav-menu {
        gap: 1.15rem;
    }

    .nav-link {
        font-size: 0.95rem;
    }

}

@media (max-width: 1024px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.65rem; }
    h3 { font-size: 1.3rem; }

    .container {
        padding: 0 18px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        padding: 0.95rem;
        gap: 0;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        display: block;
        padding: 0.72rem;
        border-bottom: 1px solid var(--gray-200);
    }

    .nav-dropdown {
        width: 100%;
        display: block;
    }

    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .nav-dropdown-menu {
        position: static;
        min-width: 0;
        margin: 0 0.5rem 0.6rem;
        border-radius: 8px;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        display: none;
        background: #f8fbff;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-item {
        padding: 0.58rem 0.72rem;
    }

    .nav-link::after {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .col-2,
    .col-3,
    .col-4,
    .col-5,
    .col-6 {
        grid-template-columns: repeat(1, 1fr);
    }

    .section,
    .section-lg {
        padding: 2.5rem 0;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .header {
        --nav-height: 68px;
    }

    .container {
        max-width: 960px;
        padding: 0 20px;
    }

    .header-content {
        padding: 0;
    }

    .main-content {
        margin-top: 68px;
    }

    .nav-menu {
        top: 68px;
        max-height: calc(100vh - 68px);
    }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .section,
    .section-lg {
        padding: 2.7rem 0;
    }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .section,
    .section-lg {
        padding: 2.35rem 0;
    }

    .footer {
        margin-top: 4rem;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .header {
        --nav-height: 64px;
    }

    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.55rem; }
    h3 { font-size: 1.22rem; }

    .container {
        padding: 0 14px;
    }

    .header-content {
        padding: 0;
    }

    .main-content {
        margin-top: 64px;
    }

    .nav-menu {
        top: 64px;
        max-height: calc(100vh - 64px);
        padding: 0.9rem;
    }
}

@media (min-width: 320px) and (max-width: 480px) {
    .header {
        --nav-height: 60px;
    }

    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.45rem; }
    h3 { font-size: 1.15rem; }

    .header-content {
        padding: 0;
    }

    .logo {
        gap: 0;
    }

    .container {
        padding: 0 12px;
    }

    .main-content {
        margin-top: 60px;
    }

    .nav-menu {
        top: 60px;
        max-height: calc(100vh - 60px);
        padding: 0.82rem;
    }

    .nav-link {
        font-size: 0.95rem;
        padding: 0.68rem 0.54rem;
    }

    .btn {
        white-space: normal;
        padding: 0.68rem 1rem;
        font-size: 0.95rem;
    }

    .footer-contact-actions {
        max-width: 100%;
    }
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.slide-in {
    animation: slideIn 0.5s ease forwards;
}

.slide-in-up {
    animation: slideInUp 0.5s ease forwards;
}

/* ================================
   UTILITY CLASSES
   ================================ */

.d-none {
    display: none !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

.cursor-pointer {
    cursor: pointer;
}

.text-muted {
    color: var(--text-lighter);
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.bg-light {
    background-color: var(--light-color);
}

.bg-primary {
    background-color: var(--primary-color);
}

/* ================================
   ACCESSIBILITY
   ================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    .header,
    .footer,
    .mobile-menu-toggle,
    .admin-link {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}
