/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
        margin: 1.5rem 0;
    }
    nav {
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    nav a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    main {
        padding: 0 15px;
    }
    .black-green {
        font-size: 0.9rem;
        padding: 1.2rem;
        margin: 1rem 0;
        overflow-x: auto;
    }
    h2 {
        font-size: 1.5rem;
    }
    h3 {
        font-size: 1.2rem;
    }
    p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    nav a {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    .black-green {
        font-size: 0.8rem;
        padding: 1rem;
    }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 0;
}

html:not(:has(:target)) {
    scroll-behavior: auto;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #072edb 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: #333;
    line-height: 1.7;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1 {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 2rem 0;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 2px;
    animation: fadeInDown 0.8s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

nav a {
    text-decoration: none;
    color: #555;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover {
    color: #667eea;
}

nav a:hover::after {
    width: 80%;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

h2 {
    color: #667eea;
    font-size: 2.2rem;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #667eea;
    animation: fadeInLeft 0.6s ease;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

h3 {
    color: #764ba2;
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem 0;
    font-weight: 600;
    animation: fadeInRight 0.6s ease;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

h3.dom {
    color: #667eea;
    font-size: 1.8rem;
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

p {
    margin: 1rem 0;
    color: #555;
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
}

.black-green {
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
    color: #00ff88;
    line-height: 1.8;
    font-family: 'Courier New', 'Consolas', monospace;
    border-radius: 12px;
    padding: 1.5rem;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 1rem 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 136, 0.2);
    position: relative;
    overflow-x: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.black-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.35);
}

.black-green::before {
    content: 'CODE';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.7rem;
    color: rgba(0, 255, 136, 0.5);
    letter-spacing: 2px;
    font-weight: bold;
}

#dom, #dom-manipulation, #dom-event, #advanced-dom {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

#dom:hover, #dom-manipulation:hover, #dom-event:hover, #advanced-dom:hover {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    transform: translateY(-3px);
}

footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #333;
    text-align: center;
    padding: 2rem 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-top: 3rem;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

footer p {
    color: #667eea;
    font-weight: 600;
    font-size: 1rem;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    nav a {
        font-size: 1rem;
        padding: 0.4rem 1rem;
    }
    
    main {
        padding: 1rem;
        margin: 1rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
}
