/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header and Navigation */
.navbar {
    background-color: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand h1 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-menu {
    position: relative;
}

.menu-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 1000;
}

.menu-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.menu-dropdown a:last-child {
    border-bottom: none;
}

.menu-dropdown a:hover {
    background-color: #f8f9fa;
}

.login-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

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

/* Main content */
.main-content {
    flex: 1;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 0;
}

.hero-content h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 400;
}

.hero-content p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
    line-height: 1.8;
}

/* Run button */
.run-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.5rem 3rem;
    font-size: 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.run-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.run-btn:active {
    transform: translateY(0);
}

.run-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Result container */
.result-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.result-container h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.genre-results {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.genre-item {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    min-width: 200px;
    text-align: center;
}

.genre-label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.genre-value {
    display: block;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Content sections */
.content-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.content-container h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-align: center;
}

.genre-grid,
.subgenre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.item-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid #667eea;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.item-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.item-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.item-count,
.item-genre {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.submit-btn {
    width: 100%;
    background-color: #667eea;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.submit-btn:hover {
    background-color: #5a6fd8;
}

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

footer p {
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .nav-brand h1 {
        font-size: 1.5rem;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .run-btn {
        padding: 1.2rem 2.5rem;
        font-size: 1.3rem;
    }

    .genre-results {
        flex-direction: column;
        gap: 1rem;
    }

    .genre-item {
        min-width: auto;
    }

    .genre-grid,
    .subgenre-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .nav-menu {
        order: 3;
    }

    .login-btn {
        align-self: flex-end;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .run-btn {
        padding: 1rem 2rem;
        font-size: 1.2rem;
    }
}

/* Animation for smooth transitions */
.content-section {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Additional hover effects */
.item-card {
    cursor: pointer;
}

.result-container {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}