* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Navigation */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-links a:hover {
    background-color: #34495e;
}

.nav-links a.active {
    background-color: #e74c3c;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background-color: white;
    border-radius: 8px;
    margin-bottom: 3rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.feature-card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn:active {
    transform: scale(0.98);
}

/* Bug Sections */
.bug-section {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.bug-section h2 {
    color: #e74c3c;
    margin-bottom: 1rem;
    border-left: 4px solid #e74c3c;
    padding-left: 1rem;
}

.bug-section p {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

/* UI/Layout Bug Styles - INTENTIONALLY BROKEN */

/* Bug #1: Broken Grid */
.broken-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* BUG: Should be 3 columns */
    gap: 1rem;
    margin: 1rem 0;
}

.grid-item {
    background-color: #3498db;
    color: white;
    padding: 2rem;
    text-align: center;
    border-radius: 4px;
}

/* Bug #2: Overlapping Elements */
.overlap-container {
    position: relative;
    height: 200px;
    margin: 1rem 0;
}

.overlap-box {
    position: absolute;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    border-radius: 4px;
}

.box-1 {
    background-color: #3498db;
    top: 0;
    left: 0;
    z-index: 3; /* BUG: Wrong z-index order */
}

.box-2 {
    background-color: #e74c3c;
    top: 50px;
    left: 100px;
    z-index: 1;
}

.box-3 {
    background-color: #2ecc71;
    top: 100px;
    left: 50px;
    z-index: 2;
}

/* Bug #3: Non-responsive */
.non-responsive {
    width: 1200px; /* BUG: Fixed width breaks on mobile */
    background-color: #ecf0f1;
    padding: 2rem;
    border-radius: 4px;
    overflow-x: auto;
}

/* Bug #4: Text Overflow */
.text-overflow {
    width: 300px;
    background-color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    white-space: nowrap; /* BUG: Prevents wrapping */
    overflow: hidden;
}

/* Bug #5: Misaligned Flexbox */
.flex-broken {
    display: flex;
    justify-content: space-around; /* BUG: Should be center */
    gap: 1rem;
    margin: 1rem 0;
}

.flex-item {
    background-color: #9b59b6;
    color: white;
    padding: 2rem;
    border-radius: 4px;
    flex: 1;
    text-align: center;
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

form input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

form label input[type="checkbox"] {
    width: auto;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: -0.5rem;
}

.success-message {
    color: #2ecc71;
    font-size: 0.9rem;
    margin-top: -0.5rem;
}

#form1-output,
#form2-output,
#form3-output,
#form4-output,
#form5-output,
#form6-output,
#error-output,
#array-output,
#type-output,
#event-output,
#async-output {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

.output-success {
    background-color: #d5f4e6;
    color: #27ae60;
    border: 1px solid #27ae60;
    display: block !important;
}

.output-error {
    background-color: #fadbd8;
    color: #c0392b;
    border: 1px solid #c0392b;
    display: block !important;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .non-responsive {
        width: 100%; /* BUG: This fix doesn't exist in the original */
    }
}
