/*===================================================================
    Enhanced Styles for Holy Family Hospital Website
    Modern, Responsive & Interactive Design
====================================================================*/

/* ============ ROOT VARIABLES ============ */
:root {
    --primary-color: #0c5cb8;
    --primary-dark: #0a4a92;
    --primary-light: #1974d2;
    --secondary-color: #d05d09;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
    --transition-speed: 0.3s;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ============ BASE STYLES ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============ NAVBAR ENHANCEMENTS ============ */
.navbar {
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar.scroll-active {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    color: white !important;
    transition: transform var(--transition-speed) ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    margin-right: 0.5rem;
    transition: transform var(--transition-speed) ease;
}

.navbar-brand:hover img {
    transform: rotate(5deg);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: all var(--transition-speed) ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 0.25rem 0.5rem;
    transition: all var(--transition-speed) ease;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Mobile menu animation */
@media (max-width: 991px) {
    .navbar-collapse {
        animation: slideDown var(--transition-speed) ease;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ BUTTONS ============ */
.btn {
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 5px;
    transition: all var(--transition-speed) ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #b84a07;
    color: white;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============ FORMS ============ */
.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: 5px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(12, 92, 184, 0.15);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem 1rem;
    padding-right: 2.5rem;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem 1rem;
    padding-right: 2.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: block;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* ============ CARDS ============ */
.card {
    border: none;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    font-weight: 600;
}

.card-title {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-text {
    color: #666;
    line-height: 1.8;
}

/* ============ ALERTS ============ */
.alert {
    border: none;
    border-radius: 5px;
    padding: 1rem 1.5rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* ============ CAROUSEL ENHANCEMENTS ============ */
.carousel-caption {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4));
    border-radius: 8px;
    padding: 2rem;
    backdrop-filter: blur(5px);
}

.carousel-caption h2,
.carousel-caption p {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.carousel-control-prev,
.carousel-control-next {
    transition: all var(--transition-speed) ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ============ SECTIONS ============ */
section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* ============ FOOTER ============ */
footer {
    background-color: var(--dark-color);
    color: #aaa;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

footer a {
    color: white;
    transition: color var(--transition-speed) ease;
}

footer a:hover {
    color: var(--secondary-color);
}

footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

footer ul {
    list-style: none;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer ul li a {
    display: inline-flex;
    align-items: center;
}

footer ul li a::before {
    content: '→';
    margin-right: 0.5rem;
    opacity: 0;
    transition: all var(--transition-speed) ease;
}

footer ul li a:hover::before {
    opacity: 1;
    margin-right: 0.75rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 0.5rem;
    transition: all var(--transition-speed) ease;
}

.social-links a:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ============ BACK TO TOP BUTTON ============ */
#backToTopBtn {
    animation: fadeIn var(--transition-speed) ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============ RESPONSIVE DESIGN ============ */
/* Extra Small Devices (< 576px) */
@media (max-width: 575.98px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    section {
        padding: 2rem 0;
    }

    .section-title {
        margin-bottom: 1.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .carousel-caption {
        padding: 1rem;
    }

    .carousel-caption h2 {
        font-size: 1.3rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-brand img {
        width: 40px;
    }

    footer {
        padding: 2rem 0 0.5rem;
    }

    .col-md-4 {
        margin-bottom: 2rem;
    }

    .card {
        margin-bottom: 1.5rem;
    }
}

/* Small Devices (576px - 767px) */
@media (max-width: 767.98px) {
    .navbar-collapse {
        background-color: rgba(0, 0, 0, 0.8);
        border-radius: 0 0 8px 8px;
        margin-top: 0.5rem;
    }

    .nav-link {
        padding: 0.75rem 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link::after {
        display: none;
    }

    .nav-link.active {
        background-color: transparent;
        border-left: 3px solid var(--secondary-color);
        padding-left: 1rem !important;
    }
}

/* Medium Devices (768px and up) */
@media (min-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    section {
        padding: 3rem 0;
    }
}

/* Large Devices (992px and up) */
@media (min-width: 992px) {
    .navbar {
        padding: 1rem 0;
    }

    .nav-link::after {
        display: block;
    }
}

/* Extra Large Devices (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }

    h1 {
        font-size: 3rem;
    }
}

/* ============ 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-width: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============ ANIMATIONS ============ */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.reveal {
    opacity: 0;
    animation: slideUp 0.6s ease forwards;
}

.reveal.revealed {
    animation: slideUp 0.6s ease forwards;
}

/* ============ UTILITIES ============ */
.text-center {
    text-align: center;
}

.text-white {
    color: white;
}

.text-dark {
    color: var(--dark-color);
}

.text-muted {
    color: #6c757d;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.pt-5 {
    padding-top: 3rem;
}

.pb-5 {
    padding-bottom: 3rem;
}

.bg-primary {
    background-color: var(--primary-color);
}

.bg-light {
    background-color: var(--light-color);
}

.bg-dark {
    background-color: var(--dark-color);
}

.container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ============ LOADING ANIMATION ============ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* ============ SMOOTH TRANSITIONS ============ */
* {
    transition-property: color, background-color, border-color, box-shadow;
    transition-duration: var(--transition-speed);
    transition-timing-function: ease;
}

/* ============ PRINT STYLES ============ */
@media print {
    .navbar,
    footer,
    #backToTopBtn {
        display: none;
    }

    body {
        font-size: 12pt;
        color: black;
    }

    a {
        color: black;
    }

    .btn {
        background-color: white;
        border: 1px solid black;
    }
}
