/* =================================
   THEME VARIABLES
   ================================= */
:root {
    /* Default to Dark Theme */
    --bg-primary: #0f0f23;
    --bg-gradient: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    --bg-glass: rgba(30, 30, 50, 0.25);
    --bg-glass-hover: rgba(45, 45, 65, 0.35);
    --text-primary: #ffffff;
    --text-secondary: #a8b3cf;
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --accent-primary: #ff6b35;
    --accent-hover: #ff5722;
    --accent-gradient: linear-gradient(135deg, #ff6b35, #f97316);
    --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --bg-primary: #f4f4f5;
    --bg-gradient: linear-gradient(135deg, #ffffff 0%, #e9ecef 100%);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --bg-glass-hover: rgba(255, 255, 255, 0.8);
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --border-primary: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* =================================
   GLOBAL STYLES
   ================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.7;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    padding-top: 80px;
    transition: background 0.3s ease, color 0.3s ease;
}

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

h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--accent-hover);
}

/* =================================
   NAVIGATION BAR
   ================================= */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 80px;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-primary);
}

.nav-logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}
.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
}
.logo-text {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.nav-center {
    text-align: center;
}
.nav-center a, .nav-actions a {
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 0.5rem 0;
    margin: 0 1.5rem;
    text-decoration: none;
}
.nav-center a:hover, .nav-actions a:hover { color: var(--text-primary); }
.nav-center a.active, .nav-actions a.active { color: var(--text-primary); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* =================================
   HERO SECTION
   ================================= */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    margin-top: -80px;
    background-size: cover;
    background-position: center;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    color: white;
}
.hero-content h1 { font-size: 4.5rem; color: white; }
.hero-content p { font-size: 1.25rem; color: rgba(255, 255, 255, 0.9); }

/* =================================
   BUTTONS & CARDS
   ================================= */
.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--shadow-primary);
}
.button:hover, button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    filter: brightness(1.1);
}

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--border-primary);
    padding: 2rem;
    transition: all 0.3s ease;
}
.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
}
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* =================================
   FORMS
   ================================= */
.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}
.form-card { max-width: 500px; width: 100%; }
.form-card h1 { text-align: center; }

input[type="text"], input[type="password"], input[type="email"], textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* =================================
   ADMIN & COMMENT STYLES
   ================================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}
.page-header h1 { margin: 0; }

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}
.admin-list-card-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}
.admin-list-card-footer form { margin: 0; }
.admin-list-card-footer .button {
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
}

.comments-section { max-width: 800px; margin: 40px auto; }
.comment-card { display: flex; gap: 1.5rem; }
.comment-form-card .form-group label { display: block; margin-bottom: 0.75rem; font-weight: 600; }
.form-actions { display: flex; justify-content: flex-end; }

/* =================================
   FLASH MESSAGES
   ================================= */
.flash-error {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #f8d7da;
}
[data-theme="light"] .flash-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* =================================
   COLORFUL SKILL CARDS
   ================================= */

.skill-card {
    display: flex;
    align-items: center;
    gap: 1rem; /* Space between logo and text */
    padding: 1rem 1.5rem;
    transition: all 0.3s ease !important;
}

.skill-card i {
    font-size: 2.5rem; /* Size of the logo */
}

.skill-card h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.skill-card h3 { margin: 0; font-size: 1.1rem; }
.skill-card[data-skill-name="java"] { background: #f89820; color: white; }
.skill-card[data-skill-name="python"] { background: #3776ab; color: white; }
.skill-card[data-skill-name="machine-learning"] { background: #8e44ad; color: white; }
.skill-card[data-skill-name="artificial-intelligence"] { background: #2980b9; color: white; }
.skill-card[data-skill-name="web-development"] { background: #e67e22; color: white; }
.skill-card[data-skill-name="react"] { background: #61dafb; color: #000; }
.skill-card[data-skill-name="node"] { background: #339933; color: white; }

/* =================================
   THEME TOGGLE & RESPONSIVE NAV
   ================================= */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: color 0.3s ease, background-color 0.3s ease;
}
.theme-toggle:hover {
    color: var(--text-primary);
    background-color: var(--bg-glass-hover);
}
body:not([data-theme="light"]) .theme-toggle .fa-sun { display: block; }
body:not([data-theme="light"]) .theme-toggle .fa-moon { display: none; }
[data-theme="light"] .theme-toggle .fa-sun { display: none; }
[data-theme="light"] .theme-toggle .fa-moon { display: block; }

.hamburger-menu { display: none; }
.mobile-nav-menu { display: none; }

@media (max-width: 850px) {
    .nav-center, .nav-actions { display: none; }
    .hamburger-menu {
        display: grid;
        place-items: center;
        font-size: 1.5rem;
        color: var(--text-primary);
        background: none;
        border: 1px solid var(--border-primary);
        border-radius: 12px;
        width: 44px;
        height: 44px;
        cursor: pointer;
        z-index: 1001;
    }
    .hamburger-menu .fa-times { display: none; }
    .hamburger-menu .fa-bars { display: block; }
    .hamburger-menu.is-active .fa-times { display: block; }
    .hamburger-menu.is-active .fa-bars { display: none; }

    .mobile-nav-menu {
        position: fixed;
        top: 0; left: 0; width: 100vw; height: 100vh;
        background: var(--bg-primary);
        z-index: 1000;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        opacity: 0;
        pointer-events: none;
        transform: scale(1.1);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }
    .mobile-nav-menu.is-open { opacity: 1; pointer-events: all; transform: scale(1); }
    .mobile-nav-menu a { font-size: 1.8rem; font-weight: 600; color: var(--text-secondary); }
    .mobile-nav-menu a:hover { color: var(--text-primary); }
    .mobile-nav-menu .theme-toggle { position: absolute; bottom: 3rem; }
    
    body { padding-top: 70px; }
    .navbar { height: 70px; padding: 1rem 1.5rem; }

    .hero-section { 
        margin-top: -70px;
        padding: 0 1rem;
    }
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }

    .footer-content, .footer-links {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .form-card {
        padding: 2rem;
        margin: 1rem;
    }
    .form-card h1 {
        font-size: 1.8rem;
    }
}

/* =================================
   FOOTER
   ================================= */
.site-footer {
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-primary);
    transition: border-color 0.3s ease;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.footer-socials a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.footer-socials a:hover {
    color: var(--text-primary);
    transform: translateY(-3px);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Responsive styles are located inside the @media (max-width: 768px) block */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}