/* CSS Variables for Colors */
:root {
    /* Main fonts */
    --font-main-title: 'Bebas Neue', Arial, Helvetica, sans-serif;
    /* Light theme colors */
    --color-primary: #3B82F6;
    --color-primary-hover: #60A5FA;
    
    /* Background colors */
    --bg-light-main: #f8f9fa;
    --bg-light-card: #ffffff;
    --bg-light-section: #f8fafc;
    --bg-light-steam: #1e1e1e;
    --bg-light-steam-hover: #5ba1eb;
    --bg-light-button: #e5e7eb;
    
    /* Text colors light theme */
    --text-light-primary: #1f2937;
    --text-light-secondary: #4a5568;
    --text-light-tertiary: #4b5563;
    --text-light-dark: #2d3748;
    --text-light-footer: #1a202c;
    --text-light-white: #ffffff;
    
    /* Dark theme backgrounds */
    --bg-dark-main: #374151;
    --bg-dark-card: #1E1E1E;
    --bg-dark-section: #1a1a1a;
    --bg-dark-footer: #2d3748;
    --bg-dark-steam: #1e1e1e;
    --bg-dark-steam-hover: #5ba1eb;
    
    /* Text colors dark theme */
    --text-dark-primary: #cecece;
    --text-dark-secondary: #a0aec0;
    --text-dark-light: #f7fafc;
    
    /* Modal and overlay colors */
    --overlay-dark: rgba(0, 0, 0, 0.9);
    --overlay-light: rgba(0, 0, 0, 0.5);
    --overlay-button: rgba(255, 255, 255, 0.1);
    --overlay-button-hover: rgba(255, 255, 255, 0.2);
}

/* Animated Title Styles */
.animated-title {
    display: inline-block;
}

.animated-title span {
    display: inline-block;
    font-family: var(--font-main-title);
    animation: vibrate 0.6s infinite;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: none;
    text-rendering: optimizeSpeed;
}

/* Default font for titles when not animated */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main-title);
}

@keyframes vibrate {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(0.5px, 0.5px) rotate(0.5deg);
    }
    50% {
        transform: translate(-0.5px, -0.5px) rotate(-0.5deg);
    }
    75% {
        transform: translate(-0.5px, 0.5px) rotate(0.5deg);
    }
    100% {
        transform: translate(0.5px, -1px) rotate(-0.5deg);
    }
}

/* Font Family for Pixelify Mode */
body.font-pixelify {
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: none;
    text-rendering: optimizeSpeed;
    font-size: 1.2em;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-align: center;
    width: 100%;
    color: var(--text-light-primary);
}

/* Project Cards */
.project-card {
    padding: 1.5rem;
    cursor: pointer;
}

/* Project Titles */
.project-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-light-primary);
}

/* Project Descriptions */
.project-description {
    font-size: 1.125rem;
    color: var(--text-light-tertiary);
}

/* Project Detail Titles */
.project-detail-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--text-light-primary);
}

/* Project Detail Descriptions */
.project-detail-description {
    color: var(--text-light-tertiary);
}

/* Header Description */
.header-description {
    font-size: 1.125rem;
    line-height: 1.75;
    margin-bottom: 2rem;
    max-width: 800px;
    margin: 1.5rem auto;
    color: var(--text-light-secondary);
}

/* Technology Names */
.technology-name {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-light-dark);
}

/* Technology Levels */
.technology-level {
    font-family: var(--font-main-title);
    font-size: 1.2rem;
    color: var(--text-light-secondary);
}

/* Footer Project Titles */
.footer-project-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-light-footer);
}

/* Footer Project Descriptions */
.footer-project-description {
    font-size: 1.125rem;
    color: var(--text-light-tertiary);
}

h2 {
    font-weight: bold !important;
}

/* Project Card Functionality */
.project-card {
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: fit-content;
    padding: 0;
    width: 100%;
    max-width: 500px;
    border-radius: 0;
}

.project-card:hover {
    transform: translateY(-10px);
}

/* Project Details Toggle */
.project-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    margin-top: 0.5rem;
}

.project-details.active {
    max-height: 1000px;
}

.project-card-description{
    margin-top: 0px;
}

/* Image styles - Full visibility priority */
.project-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0.25rem 0;
    border-radius: 0;
    background-color: var(--bg-light-main);
}

.dark .project-card img {
    background-color: var(--bg-dark-main);
}

/* Title styling - Compact */
.project-title {
    margin: 0.5rem 0 0.25rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Project details - Compact spacing */
.project-detail-description {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    line-height: 1.4;
}

/* Video container - Maintain aspect ratio */
.project-video {
    width: 100%;
    aspect-ratio: 16/9;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

/* Steam link - Compact */
.steam-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--bg-light-steam);
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-size: 0.875rem;
    width: 100%;
    margin-top: 0px;
    margin-bottom: 30px;
}

.steam-link:hover {
    background-color: var(--bg-light-steam-hover);
}

.dark .steam-link {
    background-color: var(--bg-dark-steam);
}

.dark .steam-link:hover {
    background-color: var(--bg-dark-steam-hover);
}

/* Header Description */
.header-description {
    max-width: 800px;
    margin: 1.5rem auto;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--text-light-secondary);
}

.dark .header-description {
    color: var(--text-dark-secondary);
}

/* Technologies Section */
.technologies-section {
    margin: 1rem auto;
    max-width: 1000px;
}

.technologies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.technology-card {
    background-color: var(--bg-light-card);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.dark .technology-card {
    background-color: var(--bg-dark-card);
}

.technology-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 1rem;
}

.technology-name {
    font-weight: 600;
    color: var(--text-light-dark);
    margin-bottom: 0.5rem;
}

.dark .technology-name {
    color: var(--text-dark-light);
}

.technology-level {
    font-size: 0.875rem;
    color: var(--text-light-secondary);
}

.dark .technology-level {
    color: var(--text-dark-secondary);
}

/* Footer Projects Section */
.footer-projects {
    background-color: var(--bg-light-section);
    padding: 4rem 0;
    margin-top: 4rem;
}

.dark .footer-projects {
    background-color: var(--bg-dark-section);
}

.footer-projects-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-projects-title {
    text-align: center;
    margin-bottom: 2rem;
}

.footer-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.footer-project-card {
    background-color: var(--bg-light-card);
    transition: transform 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.dark .footer-project-card {
    background-color: var(--bg-dark-footer);
}

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

.footer-project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.footer-project-content {
    padding: 1.5rem;
}

.footer-project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light-footer);
}

.dark .footer-project-title {
    color: var(--text-dark-light);
}

.footer-project-description {
    color: var(--text-light-tertiary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.dark .footer-project-description {
    color: var(--text-dark-primary);
}

/* Image Viewer Modal */
.image-viewer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-dark);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-viewer-modal.active {
    display: flex;
    opacity: 1;
}

.image-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-viewer-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 1001;
}

.image-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1001;
}

.image-viewer-nav button {
    background: var(--overlay-button);
    border: none;
    color: white;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.image-viewer-nav button:hover {
    background: var(--overlay-button-hover);
}

.image-viewer-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background: var(--overlay-light);
    padding: 5px 15px;
}

/* Social Media Links */
.social-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-link {
    color: var(--text-light-secondary);
    transition: color 0.3s ease;
    padding: 0.5rem;
}

.dark .social-link {
    color: var(--text-dark-secondary);
}

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

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

.social-icon {
    width: 24px;
    height: 24px;
}

/* Projects Grid Layout - Redesigned */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.75rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.5rem 0;
    justify-items: center;
}

/* Responsive adjustments */
@media (min-width: 768px) and (max-width: 1199px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (min-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 767px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .project-card {
        padding: 0.5rem;
        max-width: 100%;
    }
    
    .project-card img {
        margin: 0.125rem 0;
    }
    
    .project-title {
        font-size: 1rem;
        margin: 0.25rem 0;
    }
    
    .project-detail-description {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
}

/* Section Styles */
.projects-section {
    text-align: center;
    margin-bottom: 0.25rem;
}

.section-title {
    margin-bottom: 1rem;
    color: var(--text-light-primary);
}

/* Header Section */
.header-section {
    padding: 0.5rem 0 1rem;
    text-align: center;
}

/* Dark Mode Styles - Consolidated */
.dark h2, 
.dark p,
.dark .section-title,
.dark .project-title,
.dark .project-description,
.dark .project-detail-title,
.dark .project-detail-description,
.dark .header-description,
.dark .technology-name,
.dark .technology-level,
.dark .footer-project-title,
.dark .footer-project-description {
    color: var(--text-dark-primary);
}

.dark #fontToggle, 
.dark #themeToggle {
    background-color: var(--bg-dark-card);
}