/* ========================================
   กลุ่มงานการพยาบาล - โรงพยาบาลสีชมพู
   Nursing Department Styles
   ======================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ffeef7 0%, #f8f9ff 100%);
    min-height: 100vh;
}

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

/* ========================================
   Header
   ======================================== */
header {
    background: linear-gradient(135deg, #e91e63 0%, #f06292 50%, #f8bbd9 100%);
    color: #fff;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(233, 30, 99, .3);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="70" cy="30" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.header-content {
    position: relative;
    z-index: 2;
}

.logo-container {
    margin-bottom: 1rem;
}

.logo-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .1);
    padding: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .2);
}

.logo-image-error {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .2);
}

.logo-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: .5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, .3);
}

.logo-title i {
    margin-right: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.subtitle {
    font-size: 1.2rem;
    opacity: .9;
    font-weight: 300;
}

/* ========================================
   Navigation
   ======================================== */
nav {
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, .1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #e91e63;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-menu li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: .5rem 1rem;
    border-radius: 25px;
    transition: .3s;
    display: block;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: linear-gradient(135deg, #e91e63, #f06292);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, .3);
}

/* ========================================
   Main Content
   ======================================== */
main {
    padding: 3rem 0;
}

.section {
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(30px);
}

.section-title {
    font-size: 2.2rem;
    color: #e91e63;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #e91e63, #f06292);
    border-radius: 2px;
}

/* ========================================
   Cards
   ======================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
    transition: .3s;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(233, 30, 99, .1);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #e91e63, #f06292, #f8bbd9);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(233, 30, 99, .15);
}

.card-icon {
    font-size: 3rem;
    color: #e91e63;
    margin-bottom: 1rem;
    display: block;
}

.card-title {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-content {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ========================================
   Download / Button Sections
   ======================================== */
.download-section {
    border-top: 1px solid #f0f0f0;
    padding-top: 1.5rem;
    text-align: center;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e91e63, #f06292);
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    font-size: .9rem;
    transition: .3s;
    box-shadow: 0 4px 15px rgba(233, 30, 99, .3);
    border: none;
    cursor: pointer;
}

.download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, .5);
    text-decoration: none;
    color: #fff;
}

.download-info {
    margin-top: 8px;
    font-size: .8rem;
    color: #999;
}

/* ========================================
   Services & Reports
   ======================================== */
.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.service-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .08);
    transition: .3s;
    border-left: 4px solid #e91e63;
    position: relative;
    overflow: hidden;
}

.service-item::after {
    content: "";
    position: absolute;
    top: 0;
    right: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(233, 30, 99, .1) 0%, transparent 70%);
    border-radius: 50%;
}

.service-item:hover {
    transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, .12);
}

.service-item i {
    color: #e91e63;
    margin-right: 10px;
    font-size: 1.2rem;
}

.service-item h3 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.report-card {
    background: linear-gradient(135deg, #fff 0%, #fef7f7 100%);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .08);
    transition: .3s;
    border: 1px solid rgba(233, 30, 99, .1);
}

.report-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(233, 30, 99, .12);
}

.report-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #e91e63, #f06292);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.report-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: .8rem;
    font-weight: 600;
}

.report-desc {
    color: #666;
    font-size: .95rem;
}

/* ========================================
   Images
   ======================================== */
.intro-image {
    text-align: center;
    margin: 2rem 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
}

.main-activity-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 20px;
    transition: transform .3s;
}

.main-activity-image:hover {
    transform: scale(1.02);
}

.intro-image img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 200px;
    background: #f0f0f0;
    width: 100%;
    margin: 0 auto;
    object-fit: cover;
}

/* ========================================
   Popups
   ======================================== */
.knowledge-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.knowledge-popup.active {
    display: flex;
}

.popup-content {
    background: #fff;
    border-radius: 20px;
    max-width: 1000px;
    max-height: 90vh;
    width: 95%;
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    animation: popupSlideIn .3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    background: linear-gradient(135deg, #e91e63, #f06292);
    color: #fff;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.popup-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .3s;
}

.popup-close:hover {
    background: rgba(255, 255, 255, .2);
}

.popup-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.knowledge-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.knowledge-category {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: .3s;
}

.knowledge-category:hover {
    box-shadow: 0 4px 15px rgba(233, 30, 99, .1);
    border-color: #e91e63;
}

.category-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-header i {
    color: #e91e63;
    width: 20px;
}

.category-items {
    padding: 0;
}

.knowledge-item {
    display: block;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: .3s;
    background: #fff;
}

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

.knowledge-item:hover {
    background: #f8f9fa;
    color: #e91e63;
    padding-left: 2rem;
    text-decoration: none;
}

.knowledge-item::before {
    content: "📄";
    margin-right: 8px;
}

/* Statistics in popups */
.statistics-overview {
    background: linear-gradient(135deg, #fef7f7, #f8f9ff);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid #e91e63;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}

.stat-number {
    font-size: 2rem;
    color: #e91e63;
    font-weight: 700;
}

.stat-label {
    color: #666;
    font-size: .9rem;
}

/* ========================================
   Loading
   ======================================== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e91e63, #f06292);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity .5s;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Scroll to Top Button
   ======================================== */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e91e63, #f06292);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(233, 30, 99, .3);
    opacity: 0;
    visibility: hidden;
    transition: .3s;
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Footer
   ======================================== */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #f8bbd9;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.contact-item i {
    color: #f8bbd9;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
        background: #fff;
        border-radius: 10px;
        padding: 1rem;
        box-shadow: 0 5px 20px rgba(0, 0, 0, .1);
    }

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

    .nav-menu li a {
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: .5rem;
    }

    .logo-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .contact-info {
        flex-direction: column;
        gap: 1rem;
    }

    .popup-content {
        width: 95%;
        max-height: 90vh;
    }

    .popup-header {
        padding: 1rem 1.5rem;
    }

    .popup-title {
        font-size: 1.3rem;
    }

    .popup-body {
        padding: 1.5rem;
    }

    .services-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .card {
        padding: 1.5rem;
    }

    .logo-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .logo-image {
        width: 100px;
        height: 100px;
    }

    .services-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-item {
        padding: 1.2rem;
    }
}
