:root {
    --primary-color: #2c3e50;
    --accent-color: #c0392b;
    --secondary-color: #ecf0f1;
    --text-color: #333;
    --text-light: #fff;
    --card-bg: #fff;
    --bg-color: #f4f6f8;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.2);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Roboto', sans-serif;
}

/* Dark Mode Variables */
body.dark-mode {
    --primary-color: #ecf0f1;
    --accent-color: #e74c3c;
    --secondary-color: #34495e;
    --text-color: #ecf0f1;
    --text-light: #ecf0f1;
    --card-bg: #2c3e50;
    --bg-color: #1a252f;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navbar */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    display: flex;
    align-items: center;
}

.logo img {
    height: 60px;
    /* CRITICAL FIX: Limit logo height */
    width: auto;
}

.nav-links {
    display: flex;
    gap: 10px;
    /* Reduced gap to fit items better */
    align-items: center;
}

.nav-links li a {
    font-weight: 500;
    color: var(--primary-color);
    padding: 5px 8px;
    /* Slightly reduced padding */
    transition: color 0.3s;
    text-transform: uppercase;
    font-size: 0.85rem;
    /* Slightly reduced font size */
    white-space: nowrap;
    /* Prevent text wrapping */
}

.nav-links li a:hover,
.nav-links li.active a {
    color: var(--accent-color);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/MIAS/pexels-alexander-grey-1174952.jpg');
    background-size: cover;
    background-position: center;
    height: 70vh;
    /* Increased height for more impact */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

/* Add a subtle animation to the background for a modern feel */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    z-index: -1;
    transform: scale(1.05);
    filter: brightness(0.9);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--accent-color);
    font-weight: 700;
}

.cta-button img {
    height: 80px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.6);
}

/* Quote Section */
.quote-section {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
    background-color: white;
    box-shadow: var(--shadow);
    border-radius: 8px;
}

.quote-section h2 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin-bottom: 20px;
}

blockquote {
    font-size: 1.4rem;
    font-style: italic;
    color: #555;
    margin-bottom: 20px;
}

cite {
    font-weight: bold;
    color: var(--primary-color);
}

/* Info Section */
.info-section {
    background-color: white;
    padding: 60px 0;
    margin-bottom: 40px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05);
    /* Subtle separation */
}

.section-title {
    font-family: var(--font-heading);
    color: var(--primary-color);
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

.content-block {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: #444;
    line-height: 1.8;
    text-align: justify;
}

/* Tripticos */
.tripticos-links {
    text-align: center;
    margin-top: 30px;
}

.tripticos-links a {
    display: inline-block;
    margin: 0 10px;
    color: var(--accent-color);
    font-weight: bold;
    text-decoration: underline;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding-bottom: 60px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures images fill the area nicely */
}

.card-content {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: calc(100% - 180px);
}

.card h3 {
    font-family: var(--font-heading);
    margin-bottom: 10px;
    color: var(--primary-color);
}

.card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn-more {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-more:hover {
    background-color: var(--accent-color);
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 60px 0 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.footer-section p {
    color: #ccc;
    font-size: 0.9rem;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #888;
    font-size: 0.8rem;
}

/* SOS Button & Dark Mode Styles (Restored) */
.sos-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
    z-index: 9999;
    text-decoration: none;
    border: 3px solid white;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    animation: pulse 2s infinite;
}

.sos-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.6);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(231, 76, 60, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        position: relative;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: white;
        position: absolute;
        top: 100%;
        left: 0;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    body.dark-mode .nav-links {
        background-color: #2c3e50;
    }
}