:root {
    --primary-color: #1a73e8;
    --secondary-color: #ff6f61;
    --text-color: #333;
    --background-color: #f5f5f5;
    --card-background: #fff;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 20px;
}

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

.nav-links li {
    margin-left: 1.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 0.7;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex-grow: 1; 
}

h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

#mood-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

#search-btn, .submit-btn, .spin-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#search-btn:hover, .submit-btn:hover, .spin-btn:hover {
    background-color: #e55a50;
}

.loader {
    display: none;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    display: none;
    color: #d32f2f;
    margin: 1rem 0;
    text-align: center;
}

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

.movie-card {
    background-color: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.movie-card:hover {
    transform: translateY(-5px);
}

.movie-poster img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.movie-details {
    padding: 1rem;
}

.movie-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.movie-info p {
    margin-bottom: 0.5rem;
}

.form {
    max-width: 600px;
    margin: 2rem 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.success-message {
    display: none;
    color: #2e7d32;
    margin: 1rem 0;
    text-align: center;
}

.footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
}

.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 2rem auto;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #ffd700 0deg 60deg,
        #4682b4 60deg 120deg,
        #ff4500 120deg 180deg,
        #32cd32 180deg 240deg,
        #ff69b4 240deg 300deg,
        #ff6347 300deg 360deg
    );
    position: relative;
    transform: rotate(0deg);
    transition: transform 3s ease-out;
    border: 2px solid #333;
    will-change: transform;
}

.wheel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 40%;
    background-color: var(--background-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.wheel-labels {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.mood-section {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    text-align: center;
    padding-top: 30px;
}

.mood-happy { transform: rotate(30deg); }
.mood-sad { transform: rotate(90deg); }
.mood-excited { transform: rotate(150deg); }
.mood-hopeful { transform: rotate(210deg); }
.mood-thrilled { transform: rotate(270deg); }
.mood-romantic { transform: rotate(330deg); }

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid var(--primary-color);
    z-index: 10;
}

.spin-btn {
    display: block;
    margin: 1rem auto;
}

.wheel-result {
    margin-top: 2rem;
    text-align: center;
}

.wheel-result h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    #search-btn {
        width: 100%;
    }
    
    .wheel-container {
        width: 250px;
        height: 250px;
    }
    
    .mood-section {
        font-size: 0.8rem;
        padding-top: 25px;
    }
    
    .wheel-pointer {
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 16px solid var(--primary-color);
    }
}