/* ===== CSS RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #c41e3a;
    --primary-dark: #9a1830;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 30px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --font-primary: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

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

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

/* ===== HEADER & NAVIGATION ===== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

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

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.logo-text h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--white);
}

.logo-text p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.9;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

.main-nav {
    background: rgba(0,0,0,0.1);
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 0;
}

.nav-list li a {
    display: block;
    padding: 8px 16px;
    color: var(--white);
    font-size: 0.9rem;
    border-radius: 5px;
    transition: var(--transition);
}

.nav-list li a:hover,
.nav-list li a.active {
    background: rgba(255,255,255,0.2);
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 180px 20px 80px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    opacity: 0.95;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 40px;
}

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

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ===== SECTION STYLES ===== */
.section {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 30px;
}

.section-header h2 {
    color: var(--white);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.section-content {
    padding: 30px;
}

/* ===== CONTENT BLOCKS ===== */
.content-block {
    margin-bottom: 30px;
}

.content-block h3 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.content-block h4 {
    color: var(--secondary-color);
    margin-top: 25px;
}

/* ===== LISTS ===== */
.content-list {
    list-style: none;
    padding: 0;
}

.content-list li {
    padding: 12px 0 12px 35px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.content-list li:last-child {
    border-bottom: none;
}

.content-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 12px;
    width: 24px;
    height: 24px;
    background: var(--success-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ===== ALERT BOXES ===== */
.alert {
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 5px solid;
}

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

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

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

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

.alert-title {
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== STEPS ===== */
.steps-container {
    counter-reset: step-counter;
}

.step {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 10px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    margin-top: 0;
    color: var(--primary-color);
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.data-table tr:nth-child(even) {
    background: var(--light-bg);
}

.data-table tr:hover {
    background: #e9ecef;
}

/* ===== IMAGE GALLERY ===== */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-item figcaption {
    padding: 15px;
    background: var(--white);
    font-size: 0.9rem;
    text-align: center;
}

/* ===== VIDEO CONTAINER ===== */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.video-container video,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== CARDS ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

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

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

.card-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 20px;
    text-align: center;
}

.card-header h3 {
    color: var(--white);
    margin: 0;
}

.card-body {
    padding: 25px;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* ===== CHAIN OF SURVIVAL ===== */
.chain-survival {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px 0;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 10px;
}

.chain-item {
    text-align: center;
    padding: 20px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 150px;
}

.chain-item .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.chain-arrow {
    font-size: 2rem;
    color: var(--primary-color);
}

/* ===== CPR PARAMS ===== */
.cpr-params {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.param-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
}

.param-value {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.param-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: none;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 10px 0;
}

.sidebar-nav a {
    display: block;
    width: 12px;
    height: 12px;
    background: var(--border-color);
    border-radius: 50%;
    transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary-color);
    transform: scale(1.3);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 50px 20px 30px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin: 10px 0;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
}

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

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
    z-index: 999;
}

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

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* ===== PRINT STYLES ===== */
@media print {
    .header, .footer, .back-to-top, .sidebar-nav {
        display: none !important;
    }
    
    .section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .hero {
        padding: 20px;
        background: #f5f5f5 !important;
        color: #333 !important;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .sidebar-nav {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-dark);
    }
    
    .main-nav.active {
        display: block;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 20px;
    }
    
    .nav-list li a {
        padding: 12px 20px;
    }
    
    .hero {
        padding: 150px 20px 60px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .section-content {
        padding: 20px;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .chain-survival {
        flex-direction: column;
    }
    
    .chain-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .logo-text p {
        display: none;
    }
    
    .section-header {
        padding: 20px;
    }
    
    .section-header h2 {
        font-size: 1.25rem;
    }
    
    .param-card {
        padding: 15px;
    }
    
    .param-value {
        font-size: 2rem;
    }
}

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

.section {
    animation: fadeIn 0.5s ease-out;
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }
.text-danger { color: var(--accent-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.font-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1.5rem; }

/* ===== IMAGE GALLERY ===== */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-gallery figure {
    margin: 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery figure:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-gallery img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.image-gallery figcaption {
    padding: 12px 15px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-color);
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

/* ===== VIDEO CONTAINER ===== */
.video-container {
    margin: 20px 0;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 500px;
    object-fit: contain;
    background: #000;
}

.video-caption {
    padding: 12px 20px;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    text-align: center;
    font-weight: 500;
}

/* Mobile adjustments for gallery */
@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .video-container video {
        max-height: 300px;
    }
}

/* ===== LANGUAGE DROPDOWN ===== */
.language-dropdown {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.language-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 160px;
}

.language-dropdown:hover .language-menu,
.language-dropdown:focus-within .language-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid #eee;
}

.language-menu a:last-child {
    border-bottom: none;
}

.language-menu a:hover {
    background: #f5f5f5;
    color: #2563eb;
}

.language-menu a.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

.language-menu a.active:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

/* Mobile */
@media (max-width: 768px) {
    .language-dropdown {
        top: 12px;
        right: 12px;
    }
    
    .language-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .language-menu {
        min-width: 150px;
    }
    
    .language-menu a {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .language-dropdown {
        top: 10px;
        right: 10px;
    }
    
    .language-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* ===== IMPROVED MOBILE RESPONSIVE ===== */
@media (max-width: 480px) {
    .hero {
        padding: 120px 15px 40px;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-item {
        padding: 15px 20px;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .section-icon {
        display: block;
        margin-bottom: 8px;
    }
    
    .cpr-params {
        flex-direction: column;
        gap: 10px;
    }
    
    .param-card {
        padding: 12px;
    }
    
    .chain-survival {
        flex-direction: column;
        gap: 10px;
    }
    
    .chain-arrow {
        transform: rotate(90deg);
        font-size: 1.2rem;
    }
    
    .chain-item {
        padding: 15px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .video-container {
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .video-caption {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .step {
        gap: 12px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    .step-content h4 {
        font-size: 1rem;
    }
    
    .step-content p {
        font-size: 0.9rem;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
    
    .alert {
        padding: 15px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 25px;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }
}

/* ===== IMAGE STYLES ===== */
.content-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
}

.image-container {
    text-align: center;
    margin: 15px 0;
}

.image-container img {
    max-width: 100%;
    height: auto;
}

.image-caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 8px;
    font-style: italic;
    text-align: center;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.image-grid img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.step-content .image-grid {
    margin-top: 10px;
}

.step-content .image-grid img {
    max-height: 200px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .step-content .image-grid img {
        max-height: 150px;
    }
}
