/* Basic Reset & Font */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa; /* Lighter grey background */
    color: #343a40; /* Darker text color */
    line-height: 1.6;
}

/* Header Styling */
header {
    background-color: #343a40; /* Dark grey */
    color: #f8f9fa; /* Light text */
    padding: 2.5rem 1rem;
    text-align: center;
    border-bottom: 5px solid #007bff; /* Blue accent */
}

header h1 {
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    font-size: 2.5rem;
}

header p {
    margin: 0;
    font-weight: 300;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content Area */
main {
    max-width: 1200px;
    margin: 3rem auto; /* Center the content with more top/bottom margin */
    padding: 0 1.5rem;
}

main h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: #495057; /* Slightly lighter dark grey */
}

/* Project Grid Layout */
.project-grid {
    display: grid;
    /* Adjust minmax for desired card width */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem; /* Increased gap */
}

/* Individual Project Card Styling */
.project-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6; /* Light border */
    border-radius: 8px;
    padding: 1.5rem 1.75rem; /* Slightly more padding */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); /* Softer shadow */
    transition: transform 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    justify-content: space-between; /* Push links to bottom */
    min-height: 200px; /* Ensure cards have consistent minimum height */
}

.project-card:hover {
    transform: translateY(-6px); /* Slightly more lift */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); /* Increased shadow on hover */
}

.project-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #007bff; /* Blue title */
}

.project-card p {
    font-size: 0.95rem; /* Slightly larger description text */
    color: #495057;
    flex-grow: 1; /* Allow description to take available space */
    margin-bottom: 1.5rem; /* Space above the links */
}

/* Project Links Container */
.project-links {
    margin-top: auto; /* Push to the bottom */
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller cards/screens */
    gap: 0.75rem; /* Space between buttons */
}

/* Button Styling (General) */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Primary Button (View Project) */
.btn-primary {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #ffffff;
}

/* Secondary Button (View Code) */
.btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #ffffff;
}


/* Footer Styling */
footer {
    text-align: center;
    margin-top: 4rem;
    padding: 1.5rem 1rem;
    font-size: 0.9rem;
    color: #6c757d; /* Grey text */
    border-top: 1px solid #dee2e6; /* Light border */
    background-color: #e9ecef; /* Very light grey background */
}

footer p {
    margin: 0.3rem 0;
}

footer a {
    color: #007bff; /* Blue links */
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Optional: Add media queries for fine-tuning responsiveness if needed */
/* @media (max-width: 768px) { ... } */

/* ============================================
   ENHANCED BADGE SYSTEM STYLES
   ============================================ */

/* CSS Variables for Light/Dark Themes */
:root {
    /* Light Theme (Default) */
    --primary: #4e73df;
    --secondary: #f8f9fc;
    --accent: #36b9cc;
    --dark: #5a5c69;
    --light: #f8f9fc;

    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-hero: linear-gradient(135deg, #4e73df 0%, #36b9cc 100%);
    --bg-footer: #5a5c69;

    /* Text Colors */
    --text-primary: #5a5c69;
    --text-secondary: #6c757d;
    --text-on-primary: #ffffff;

    /* Border Colors */
    --border-light: #dee2e6;
    --border-medium: #ced4da;

    /* Shadow Colors */
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

/* Dark Theme - Deep Navy/Slate Palette */
[data-theme="dark"] {
    /* Sophisticated Dark Theme Colors */
    --primary: #6bb6ff; /* Bright blue primary */
    --secondary: #1e2a3a; /* Deep navy secondary */
    --accent: #8ab4f8; /* Light blue accent */
    --dark: #0f1419; /* Deep dark navy */
    --light: #2d3b4f; /* Medium slate */

    /* Background Colors - Sophisticated Dark Tones */
    --bg-primary: #3d4f63; /* Lighter card backgrounds for readability */
    --bg-secondary: #1e2a3a; /* Main background - deep navy */
    --bg-hero: linear-gradient(135deg, #2d3b4f 0%, #1e2a3a 100%); /* Softer navy gradient */
    --bg-footer: #0f1419; /* Footer - deepest navy */

    /* Text Colors - Enhanced Readability */
    --text-primary: #f0f8ff; /* Brighter white text */
    --text-secondary: #b8d4e8; /* Lighter blue-grey for secondary text */
    --text-on-primary: #ffffff;

    /* Border Colors - Lighter for Better Contrast */
    --border-light: #4a5e73; /* Lighter navy borders */
    --border-medium: #3d4f63; /* Medium borders matching cards */

    /* Shadow Colors - Navy Tinted */
    --shadow-light: rgba(30, 42, 58, 0.3);
    --shadow-medium: rgba(15, 20, 25, 0.4);
}

/* Dark Theme Body Styles */
[data-theme="dark"] body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Dark Theme Project Cards */
[data-theme="dark"] .project-card {
    background-color: var(--bg-primary);
    border-color: var(--border-light);
    box-shadow: 0 4px 6px var(--shadow-light);
}

[data-theme="dark"] .project-card:hover {
    box-shadow: 0 10px 20px var(--shadow-medium);
}

/* Dark Theme Project Titles */
[data-theme="dark"] .project-title {
    color: #ffd700; /* Golden yellow for dark backgrounds */
}

/* Dark Theme Card Text - Make Much Lighter */
[data-theme="dark"] .card-text {
    color: #ffffff !important; /* Force bright white text */
    font-weight: 400;
}

/* Dark Theme Card Body Text */
[data-theme="dark"] .card-body p {
    color: #ffffff !important; /* Bright white for descriptions */
}

/* Dark Theme Footer */
[data-theme="dark"] footer {
    background-color: var(--bg-footer);
    color: var(--text-primary);
    border-top-color: var(--border-light);
}

/* Dark Theme Social Icons */
[data-theme="dark"] .social-icon {
    color: var(--text-primary);
}

[data-theme="dark"] .social-icon:hover {
    color: var(--accent);
}

/* Dark Theme Hero Section */
[data-theme="dark"] .hero-section {
    background: var(--bg-hero);
}

/* Dark Theme Buttons - Even Lighter Colors */
[data-theme="dark"] .btn-outline-primary {
    border-color: #b8d4ff; /* Even lighter blue border */
    color: #d4e8ff; /* Very light blue text */
}

[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #a8c8ff; /* Even lighter blue background */
    border-color: #b8d4ff; /* Even lighter blue border */
    color: #1e2a3a; /* Dark navy text for contrast */
}

/* Dark Theme Skeleton Loader */
[data-theme="dark"] .skeleton-card {
    background-color: var(--bg-primary);
    box-shadow: 0 4px 6px var(--shadow-light);
}

/* Dark Theme Main Content Area */
[data-theme="dark"] main {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Dark Theme Skeleton Elements */
[data-theme="dark"] .skeleton {
    background-color: #4a5e73; /* Lighter navy for skeleton */
    background: linear-gradient(90deg, #4a5e73 25%, #5a6e83 50%, #4a5e73 75%);
    background-size: 200% 100%;
}

/* Dark Theme Project Grid Container */
[data-theme="dark"] .project-grid {
    background-color: transparent; /* Ensure it doesn't override main background */
}

/* Dark Theme Section Backgrounds */
[data-theme="dark"] section {
    background-color: var(--bg-secondary);
}

/* Theme Transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Badge Color Variables */
:root {
    /* Enhanced Language Badge Colors */
    --lang-typescript: #3178C6;
    --lang-javascript: #F1E05A;
    --lang-python: #3572A5;
    --lang-golang: #00ADD8;
    --lang-dart: #0175C2;
    --lang-java: #B07219;
    --lang-cpp: #F34B7D;
    --lang-rust: #DEA584;
    --lang-php: #4F5D95;
    --lang-ruby: #701516;
    --lang-csharp: #239120;
    --lang-swift: #FA7343;
    --lang-kotlin: #7F52FF;
    --lang-html: #E34F26;
    --lang-css: #1572B6;

    /* Enhanced Project Type Colors */
    --project-web: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --project-cli: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --project-mobile: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --project-extension: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    --project-package: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --project-mcp: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --project-learning: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --project-tts: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    --project-translation: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --project-networking: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Badge Positioning */
.project-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
}

.language-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Enhanced Language Badge Styles */
.language-badge {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.language-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Language Badge Color Classes */
.badge-typescript { background: var(--lang-typescript); color: white; }
.badge-javascript { background: var(--lang-javascript); color: #2c3e50; }
.badge-python { background: var(--lang-python); color: white; }
.badge-golang { background: var(--lang-golang); color: white; }
.badge-dart { background: var(--lang-dart); color: white; }
.badge-java { background: var(--lang-java); color: white; }
.badge-cpp { background: var(--lang-cpp); color: white; }
.badge-rust { background: var(--lang-rust); color: #2c3e50; }
.badge-php { background: var(--lang-php); color: white; }
.badge-ruby { background: var(--lang-ruby); color: white; }
.badge-csharp { background: var(--lang-csharp); color: white; }
.badge-swift { background: var(--lang-swift); color: white; }
.badge-kotlin { background: var(--lang-kotlin); color: white; }
.badge-html { background: var(--lang-html); color: white; }
.badge-css { background: var(--lang-css); color: white; }

/* Enhanced Project Badge Styles */
.project-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    min-width: 60px;
    text-align: center;
}

.project-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Project Badge Color Classes */
.badge-web { background: var(--project-web); }
.badge-cli { background: var(--project-cli); }
.badge-mobile { background: var(--project-mobile); }
.badge-extension { background: var(--project-extension); }
.badge-package { background: var(--project-package); }
.badge-mcp { background: var(--project-mcp); }
.badge-learning { background: var(--project-learning); }
.badge-tts { background: var(--project-tts); }
.badge-translation { background: var(--project-translation); }
.badge-networking { background: var(--project-networking); }

/* Button Styling */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(78, 115, 223, 0.3);
}
