/* Nowoczesna paleta kolorów i zmienne */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #8b5cf6;
    
    --text-dark: #1e293b;
    --text-light: #64748b;
    
    --bg-white: #ffffff;
    --bg-light-gray: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-light-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Szklana Nawigacja */
#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.2rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

/* KULOODPORNE WYRÓWNANIE DO PRAWEJ STRONY */
.nav-links {
    display: flex;
    flex-grow: 1; /* Zajmuje całą wolną przestrzeń między logo a krawędzią */
    justify-content: flex-end; /* Spycha wszystkie elementy twardo do prawej */
    list-style: none;
    align-items: center;
    gap: 2.5rem; /* Nowoczesne, równe odstępy zamiast marginesów */
}

.nav-links li { margin-left: 0; } /* Usunięto stare marginesy */

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-btn {
    background-color: var(--primary);
    color: white !important;
    padding: 8px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.nav-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Przycisk Hamburger */
.hamburger {
    display: none !important; /* Absolutne ukrycie na desktopie */
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    gap: 6px;
    z-index: 1010;
    padding: 5px;
    margin-left: 2rem;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* Animacja Hamburgera do X */
.hamburger.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Sekcja Hero (Dwukolumnowa) */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 5% 60px;
    background: var(--bg-gradient);
    overflow: hidden;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

#hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.dynamic-subtitle {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--accent);
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--accent);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

#hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 40px;
    max-width: 90%;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Przyciski */
.hero-buttons {
    display: flex;
    gap: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(79, 70, 229, 0.25);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(79, 70, 229, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary-hover);
    box-shadow: none;
}

/* Ogólne Sekcje */
section {
    padding: 100px 0;
}

.light-bg {
    background-color: var(--bg-white);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.section-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 60px;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Nagłówki podstron */
.page-header {
    padding-top: 140px;
    text-align: center;
    margin-bottom: 40px;
}

.page-header h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Statystyki */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-box {
    padding: 30px;
    background: var(--bg-light-gray);
    border-radius: var(--radius);
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

/* Karty Kategorii (Grid) */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.category-card, .card {
    background: var(--bg-white);
    padding: 40px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    display: block;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.category-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.category-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Stopka */
footer {
    background-color: var(--text-dark);
    color: white;
    padding: 60px 0 20px;
    text-align: center;
}

.footer-content h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.footer-content p {
    color: #94a3b8;
    margin-bottom: 20px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    color: #64748b;
    font-size: 0.9rem;
}

/* Style dla modala z modelem 3D */
.modal-3d-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(5px);
}

.modal-3d-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85vw;
    height: 85vh;
    background-color: var(--bg-white);
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: 300;
    color: var(--text-light);
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s;
}

.close-modal-btn:hover {
    color: #ef4444;
}

model-viewer {
    width: 100%;
    height: 100%;
    background-color: var(--bg-light-gray);
    border-radius: 12px;
    outline: none;
}

/* Nowa wizualizacja Hero */
.modern-visual {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.glass-code-editor {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(79, 70, 229, 0.1);
    overflow: hidden;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.glass-code-editor:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) translateY(-10px);
    box-shadow: 0 40px 70px rgba(79, 70, 229, 0.15);
}

.editor-header {
    background: rgba(255, 255, 255, 0.5);
    padding: 15px 20px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.editor-body {
    padding: 30px 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.15rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.keyword { color: #8b5cf6; font-weight: bold; }
.variable { color: #4f46e5; font-weight: 600; }
.property { color: #0f766e; }
.string { color: #ea580c; }

.floating-icon {
    position: absolute;
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    animation: float 6s ease-in-out infinite;
    z-index: 10;
}

.icon-1 {
    top: -30px;
    right: -20px;
    animation-delay: 0s;
}

.icon-2 {
    bottom: -20px;
    left: -30px;
    animation-delay: 3s;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Zdjęcia WWW & Formularz kontaktu */
.web-preview {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: #f1f5f9;
}

.web-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.web-preview img:hover {
    transform: scale(1.05);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-select,
.contact-form textarea {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    background-color: var(--bg-white);
    color: var(--text-dark);
    outline: none;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-select:focus,
.contact-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* RWD - Dostosowanie do urządzeń mobilnych */
@media (max-width: 768px) {
    #hero {
        flex-direction: column;
        text-align: center;
        padding-top: 150px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hamburger {
        display: flex !important; /* Włączenie ikony na telefonie */
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: flex-end; /* Elementy wyrównane do prawej w mobilnym menu */
        padding-right: 3rem;
        gap: 2rem;
        transition: var(--transition);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1005;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .modern-visual {
        margin-top: 40px;
    }
}