/* Global Variables & Theme */
:root {
    /* Light Theme (Default) */
    --bg-color: #f4f4f9;
    --text-color: #333333;
    --card-bg: #ffffff;
    --primary-color: #00bcd4;
    --secondary-color: #008ba3;
    --accent-color: #ff4081;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --primary-color: #00bcd4;
    --secondary-color: #00e5ff;
    --accent-color: #ff80ab;
    --nav-bg: rgba(18, 18, 18, 0.9);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

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

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-toggle {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.btn-toggle:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Dark Mode Logo Adjustment */
[data-theme="dark"] .hero-logo {
    color: #fff;
}

/* Hero Section */
.hero {
    min-height: 40vh;
    /* Reduced from 100vh to make content visible */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    padding-top: 100px;
    /* Offset for fixed nav */
    background: radial-gradient(circle at center, var(--card-bg) 0%, var(--bg-color) 100%);
}

.hero-logo {
    width: 150px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px var(--primary-color));
    animation: float 4s ease-in-out infinite;
}

.hero h1 {
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

/* Sections */
section {
    padding: 2rem 2rem;
    /* Reduced padding */
    max-width: 1200px;
    /* Increased max-width for better grid fitting */
    margin: 0 auto;
}

.section-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Skills/Interests - General Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* Increased min-width to avoid squishing */
    gap: 1.5rem;
    text-align: center;
}

/* Countdowns Specific Grid (if needed specifically for 2 rows look) */
.countdowns-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Default to 4 columns */
    gap: 1.5rem;
    text-align: center;
}

/* Responsive for countdowns */
@media (max-width: 1100px) {
    .countdowns-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on medium screens */
    }
}

@media (max-width: 600px) {
    .countdowns-grid {
        grid-template-columns: 1fr;
        /* 1 column on mobile */
    }
}

.skill-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform var(--transition-speed);
    word-wrap: break-word;
    /* Fix text overflow */
    overflow-wrap: break-word;
}

.skill-card:hover {
    transform: translateY(-5px);
}

.skill-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Contact & Footer */
.footer {
    background: var(--card-bg);
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--primary-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-color);
    font-size: 1.5rem;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: all var(--transition-speed);
}

.social-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--primary-color);
}

.footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.email-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
}

.email-link:hover {
    color: var(--primary-color);
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

th {
    background: rgba(0, 0, 0, 0.02);
    font-weight: 600;
    color: var(--primary-color);
}

[data-theme="dark"] th {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .navbar {
        padding: 1rem;
    }

    .nav-controls {
        gap: 0.5rem;
    }

    .btn-toggle {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    /* Mobile Nav */
    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--card-bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.2rem;
    }

    /* Hamburger Animation */
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* Dark Mode Logo Adjustment */
[data-theme="dark"] .hero-logo {
    filter: drop-shadow(0 0 10px var(--primary-color)) brightness(0) invert(1);
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    animation: float 2s ease-in-out infinite;
}

#back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}