/* CSS Variables */
:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --accent-color: #0ea5e9;
    --dark-blue: #1e40af;
    --light-blue: #60a5fa;
    --text-color: #1f2937;
    --muted-text: #374151;
    --light-bg: #f8fafc;
    --gradient-bg: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    --card-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.1), 0 2px 4px -1px rgba(30, 58, 138, 0.06);
}

/* Base Styles */
body {
    font-family: "Inter", sans-serif;
    color: var(--text-color);
    background: #ffffff;
    min-height: 100vh;
}

/* Focus States for Accessibility */
*:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Skip Link for Screen Readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Navbar Styles */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(6, 78, 59, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 20px rgba(6, 78, 59, 0.08);
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-nav .nav-item {
    margin: 0 0.5rem;
}

.navbar-nav .nav-link {
    color: var(--text-color) !important;
    transition: color 0.2s ease;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--accent-color) !important;
}

/* Dropdown Menu */
.dropdown-menu {
    border: 1px solid rgba(30, 58, 138, 0.1);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.15);
    border-radius: 8px;
}

.dropdown-item {
    padding: 0.7rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-color);
}

/* Section Backgrounds */
.section-light {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.section-dark {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    position: relative;
}

.section-dark::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231e3a8a' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.section-dark .container {
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero {
    min-height: 50vh;
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231e3a8a' fill-opacity='0.015'%3E%3Ccircle cx='40' cy='40' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero .display-2 {
    color: var(--primary-color);
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.hero .tagline {
    font-size: 1.3rem;
    color: var(--muted-text);
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.hero .subtitle {
    font-size: 1rem;
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Games Section - Increased Padding */
.games-section {
    padding: 50px 0;
    position: relative;
}

/* Section Headers */
.section-header {
    position: relative;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-header .lead {
    font-size: 1.2rem;
    color: var(--muted-text);
    max-width: 600px;
    margin: 0 auto;
}

.section-header::after {
    content: "";
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #38bdf8);
    border-radius: 2px;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Performance Optimization */
.project-card:hover,
.game-card:hover {
    will-change: transform;
}

/* Unified Card Styling */
.project-card,
.game-card {
    border: 1px solid rgba(30, 58, 138, 0.08);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.04);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-dark .project-card,
.section-dark .game-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(30, 58, 138, 0.12);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.08);
}

/* Card Top Accent Border */
.project-card::before,
.game-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #38bdf8, var(--light-blue));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.project-card:hover,
.game-card:hover {
    border-color: rgba(14, 165, 233, 0.2);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.12);
}

.section-dark .project-card:hover,
.section-dark .game-card:hover {
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.15);
}

.project-card:hover::before,
.game-card:hover::before {
    transform: scaleX(1);
}

/* Screenshot Container */
.project-screenshot {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    max-height: 200px;
    min-height: 150px;
}

.project-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.6s ease;
}

.project-screenshot::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.05) 0%, rgba(14, 165, 233, 0.08) 100%);
    z-index: 1;
    pointer-events: none;
}

.project-card:hover .project-screenshot img {
    transform: scale(1.05);
}

/* Project Overlay */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9) 0%, rgba(14, 165, 233, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.4s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay-icon {
    font-size: 3rem;
    color: white;
    margin-bottom: 1rem;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.project-card:hover .project-overlay-icon {
    transform: translateY(0);
}

.project-overlay-text {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
}

.project-card:hover .project-overlay-text {
    transform: translateY(0);
}

/* Card Content Areas */
.project-content {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-title-icon {
    font-size: 1.2rem;
    color: var(--accent-color);
}

.project-description {
    color: var(--muted-text);
    line-height: 1.5;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    flex-grow: 1;
}

.project-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.project-badge {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-color);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.project-status {
    color: var(--muted-text);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: auto;
}

/* Button Styles */
.btn-project-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #38bdf8 100%);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    justify-content: center;
}

.btn-project-primary:hover,
.btn-project-primary:focus {
    background: linear-gradient(135deg, #0284c7 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
    color: white;
}

.btn-project-secondary {
    background: transparent;
    border: 1px solid rgba(30, 58, 138, 0.2);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
}

.btn-project-secondary:hover,
.btn-project-secondary:focus {
    background: rgba(30, 58, 138, 0.05);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Game Card Specific Styles */
.game-card-header {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.02) 0%, rgba(59, 130, 246, 0.04) 100%);
    border-bottom: 1px solid rgba(30, 58, 138, 0.06);
    padding: 2rem 2rem 2rem;
    text-align: center;
    position: relative;
}

.section-dark .game-card-header {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.03) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.game-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    transition: all 0.4s ease;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-card:hover .game-icon {
    transform: scale(1.2) rotate(5deg);
    background: linear-gradient(135deg, var(--accent-color), #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0;
}

.game-card-body {
    padding: 2rem;
    flex-grow: 1;
}

.game-description {
    color: var(--muted-text);
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.game-card-footer {
    background: transparent;
    border-top: 1px solid rgba(30, 58, 138, 0.06);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
}

.play-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #38bdf8 100%);
    border: none;
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.play-btn:hover,
.play-btn:focus {
    background: linear-gradient(135deg, #0284c7 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
    color: white;
}

.play-btn i {
    transition: transform 0.3s ease;
}

.play-btn:hover i {
    transform: translateX(3px);
}

/* Tab Styles */
.custom-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    margin: 0 1.5rem;
    padding: 1rem 0.5rem;
    color: var(--muted-text);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    white-space: nowrap;
}

.custom-tab:hover,
.custom-tab:focus {
    background: transparent;
    border-bottom-color: rgba(14, 165, 233, 0.5);
    color: var(--primary-color);
}

.custom-tab.active {
    background: transparent;
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    margin-top: 3rem;
}

.tab-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--muted-text) !important;
    font-family: "Inter", sans-serif !important;
    margin: 0;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

/* Contact Section */
.contact-email-section {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(14, 165, 233, 0.1);
}

.email-link {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.email-link:hover,
.email-link:focus {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.email-link::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), #38bdf8);
    transition: width 0.3s ease;
}

.email-link:hover::after {
    width: 100%;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10zm10 0c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.footer-content {
    position: relative;
    z-index: 1;
}

/* Responsive Design */
@media (min-width: 768px) {
    .hero .display-2 {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .games-section {
        padding: 60px 0;
    }

    .project-screenshot {
        aspect-ratio: 16/9;
        max-height: 160px;
        min-height: 120px;
    }

    .project-screenshot img {
        object-position: top center;
    }

    .custom-tab {
        margin: 0 0.5rem;
        font-size: 0.85rem;
        padding: 0.8rem 0.3rem;
    }

    .tab-text {
        font-size: 1rem;
        text-align: left;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .hero .display-2 {
        font-size: 2.5rem;
    }

    .project-content {
        padding: 1rem;
    }

    .project-card,
    .game-card {
        margin-bottom: 1rem;
    }

    .project-actions {
        gap: 0.5rem;
    }

    .btn-project-primary,
    .btn-project-secondary {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 576px) {
    .games-section {
        padding: 40px 0;
    }

    .project-screenshot {
        aspect-ratio: 3/2;
        max-height: 140px;
        min-height: 100px;
    }

    .custom-tab {
        font-size: 0.8rem;
        padding: 0.6rem 0.2rem;
        margin: 0 0.3rem;
    }

    .hero .tagline {
        font-size: 1.1rem;
    }

    .project-actions {
        flex-direction: column;
        gap: 0.3rem;
    }

    .project-badges {
        justify-content: center;
    }

    .project-description {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .project-title {
        font-size: 1.1rem;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .fade-in,
    .project-card,
    .game-card,
    .play-btn,
    .game-icon,
    .email-link {
        transition: none;
    }

    .project-card:hover,
    .game-card:hover,
    .email-link:hover {
        transform: none;
    }
}

section[id] {
    scroll-margin-top: 60px;
    /* wysokość nawigacji */
}