
/* --- 1. GLOBAL STYLES & VARIABLES --- */
:root {
    --clr-primary: #E74C3C; /* Bright Red */
    --clr-secondary: #C0392B; /* Darker Red/Crimson */
    --clr-background: #1A1A1A; /* Deep Black */
    --clr-text: #F0F0F0; /* Off-White */
    --clr-glass-bg: rgba(40, 40, 40, 0.7); /* Dark Translucent background */
    --clr-glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--clr-text);
    background-color: var(--clr-background);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative; 
}

/* --- 2. ANIMATED BACKGROUND (The Redline Vibe) --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15; 
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(231, 76, 60, 0.1) 10px,
        rgba(231, 76, 60, 0.1) 20px 
    );
    animation: background-move 120s linear infinite;
}

@keyframes background-move {
    0% { background-position: 0 0; }
    100% { background-position: 1000px 1000px; }
}

/* --- 3. NAVBAR STYLES --- */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--clr-glass-bg); /* Use glass background for a frosted effect */
    backdrop-filter: blur(10px); /* Frosted glass effect */
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    border-bottom: 1px solid var(--clr-glass-border);
}

.navbar .logo-img {
    height: 40px; 
    width: auto; 
    vertical-align: middle;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: var(--clr-text);
    padding: 8px 15px;
    font-weight: 500;
    transition: color 0.3s ease, background-color 0.3s ease, border-radius 0.3s ease;
    border-radius: 6px;
}

.nav-link:hover {
    color: var(--clr-primary);
    background-color: rgba(231, 76, 60, 0.1);
}

.nav-link.active {
    color: var(--clr-primary);
    background-color: var(--clr-secondary);
    color: var(--clr-background); /* Invert text color for active link */
    font-weight: 700;
}

.nav-link.logo {
    padding: 0; /* Remove padding for the logo image */
}

/* --- 4. MAIN LAYOUT AND CONTAINERS --- */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.hero-header {
    text-align: center;
    padding: 60px 0 40px;
}

.hero-header h1 {
    font-size: 3.5em;
    color: var(--clr-primary);
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.tagline {
    font-size: 1.2em;
    color: #999;
}

.page-header {
    border-bottom: 2px solid var(--clr-secondary);
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 2em;
    color: var(--clr-primary);
}

/* --- 5. GLASS CARD EFFECT --- */
.glass-card {
    background-color: var(--clr-glass-bg);
    border: 1px solid var(--clr-glass-border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* --- 6. LINK AND GRID STYLES --- */
.link-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.link-card {
    flex: 1 1 200px;
    text-decoration: none;
    color: var(--clr-text);
    background-color: var(--clr-secondary);
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.link-card.small-link {
    flex: 0 0 auto;
    font-size: 0.9em;
    padding: 8px 15px;
}

.link-card:hover {
    background-color: var(--clr-primary);
    transform: translateY(-5px);
}

/* --- 7. PROJECT & ARTICLE STYLES --- */
.project-card h3, .article-summary h3 {
    color: var(--clr-primary);
    margin-bottom: 10px;
}

.project-card p, .article-summary p {
    margin-bottom: 15px;
    color: #CCC;
}

/* --- 8. SKILLS SECTION --- */
.skill-card h3 {
    color: var(--clr-text);
    border-bottom: 1px dashed var(--clr-secondary);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.skill-card p {
    font-style: italic;
    color: #999;
}

/* --- 9. CONTACT FORM STYLES --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--clr-secondary);
    border-radius: 6px;
    color: var(--clr-text);
    font-size: 1em;
}

.submit-button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: var(--clr-primary);
    color: var(--clr-background);
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-button:hover {
    background-color: #f73727;
    transform: translateY(-2px);
}

/* --- 10. SPA ROUTING STYLES (CRITICAL FOR NAVIGATION) --- */

/* Hide all content pages by default, using visibility/max-height for smooth transition */
.page-content {
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden; /* Hide content when height is zero */
    transition: opacity 0.5s ease, visibility 0.5s ease, max-height 0.5s ease; 
}

/* Only show the active page */
.page-content.active-page {
    visibility: visible;
    opacity: 1;
    max-height: 5000px; /* A large value to allow content to expand fully */
    margin: 40px auto; /* Restore original margins for layout */
}

/* --- 11. FOOTER --- */
footer {
    text-align: center;
    padding: 20px 0;
    font-size: 0.8em;
    color: #555;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- 12. MEDIA QUERIES (Responsiveness) --- */
@media (max-width: 900px) {
    .navbar {
        padding: 10px 20px;
    }

    .nav-links {
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 10px;
    }

    .nav-links {
        flex-wrap: wrap;
        margin-top: 10px;
    }

    .hero-header h1 {
        font-size: 2.5em;
    }

    .container {
        padding: 0 15px;
    }
}