body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f0f4f8;
}

.container {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

h1 {
    color: #1a365d;
    margin: 0;
    font-size: 1.8em;
}

.description {
    text-align: center;
    color: #4a5568;
    margin: 15px 0;
    font-size: 1.1em;
}

#result {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 10px -20px;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    max-width: 100%;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-text {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.user-message .message-text {
    background-color: #3182ce;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.assistant-message .message-text {
    background-color: #f7fafc;
    color: #2d3748;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.movie-container {
    width: 100%;
    max-width: 800px;
    margin-top: 8px;
    align-self: flex-start;
}

.movie-card {
    margin: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.assistant-message .movie-card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.movie-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.message.user {
    margin-left: auto;
    background-color: #4299e1;
    color: white;
}

.message.assistant {
    margin-right: auto;
    background-color: #f7fafc;
    color: #2d3748;
}

.message .icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.message p {
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message.error {
    background-color: #fff5f5;
    color: #e53e3e;
    border: 1px solid #feb2b2;
}

.search-section {
    margin-top: auto;
    padding: 20px;
    background-color: white;
    border-top: 1px solid #e2e8f0;
    margin: 0 -30px -30px -30px;
    padding: 20px 30px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="text"] {
    flex-grow: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

input[type="text"]:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    background-color: white;
}

button {
    padding: 12px 20px;
    background-color: #4299e1;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

button:hover {
    background-color: #3182ce;
    transform: translateY(-1px);
}

.new-chat-btn {
    background-color: #edf2f7;
    color: #2d3748;
    padding: 8px 16px;
    font-size: 14px;
}

.new-chat-btn:hover {
    background-color: #e2e8f0;
}

.hint {
    color: #718096;
    font-size: 0.9em;
    margin: 8px 0 0 0;
    text-align: center;
    font-style: italic;
}

.movie-details {
    margin-top: 12px;
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 12px;
    display: flex;
    gap: 24px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.movie-poster-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.movie-poster {
    width: 200px;
    height: 300px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.movie-poster-placeholder {
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}

.movie-ratings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    font-size: 0.9em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.rating-source {
    color: #4a5568;
    font-weight: 500;
}

.rating-value {
    color: #d69e2e;
    font-weight: 600;
}

.movie-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.movie-title-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.movie-title-year {
    font-size: 1.6em;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    line-height: 1.2;
}

.imdb-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(214, 158, 46, 0.1);
    border-radius: 6px;
    font-size: 1.1em;
}

.rating-icon {
    color: #d69e2e;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(74, 85, 104, 0.1);
    border-radius: 20px;
    font-size: 0.9em;
    color: #4a5568;
}

.meta-item.genre {
    background: rgba(66, 153, 225, 0.1);
    color: #2b6cb0;
}

.meta-item.rating-badge {
    background: rgba(245, 101, 101, 0.1);
    color: #c53030;
}

.movie-plot {
    color: #4a5568;
    line-height: 1.6;
    font-size: 1em;
    margin: 8px 0;
}

.movie-plot p {
    margin: 0;
}

.movie-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    color: #718096;
    font-size: 0.9em;
    font-weight: 500;
}

.detail-value {
    color: #2d3748;
    font-size: 0.95em;
    line-height: 1.4;
}

.detail-item.awards {
    grid-column: 1 / -1;
    background: rgba(255, 215, 0, 0.1);
    padding: 12px;
    border-radius: 8px;
}

.detail-item.awards .detail-label {
    color: #b7791f;
}

.movie-card {
    margin: 16px 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.movie-card.closing {
    transform: scale(0.95);
    opacity: 0;
}

.movie-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.movie-card-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.movie-card-title h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.movie-year {
    color: #718096;
    font-size: 1rem;
}

.movie-card-controls {
    display: flex;
    gap: 8px;
}

.card-control-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #718096;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.card-control-btn:hover {
    background: #edf2f7;
    color: #2d3748;
}

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

.movie-card-content {
    display: flex;
    gap: 24px;
    padding: 16px;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.movie-card.minimized .movie-card-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.movie-poster-section {
    flex-shrink: 0;
    width: 200px;
}

@media (max-width: 768px) {
    .movie-details {
        flex-direction: column;
        padding: 16px;
        gap: 20px;
    }
    
    .movie-poster-section {
        align-items: center;
    }
    
    .movie-poster {
        width: 180px;
        height: 270px;
    }
    
    .movie-ratings {
        width: 100%;
        max-width: 300px;
    }
    
    .movie-title-year {
        font-size: 1.4em;
    }
    
    .movie-details-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .movie-card-content {
        flex-direction: column;
        gap: 16px;
    }

    .movie-poster-section {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .movie-poster {
        width: 180px;
        height: 270px;
    }

    .movie-card-title h3 {
        font-size: 1.1rem;
    }

    .movie-year {
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        height: calc(100vh - 20px);
    }

    .message {
        max-width: 90%;
        margin: 4px 10px;
    }

    .input-wrapper {
        flex-direction: column;
    }
    
    button {
        width: 100%;
        justify-content: center;
    }

    .search-section {
        padding: 15px 20px;
        margin: 0 -20px -20px -20px;
    }
}

@media (max-width: 480px) {
    .movie-card-header {
        padding: 8px 12px;
    }

    .movie-card-content {
        padding: 12px;
    }

    .movie-poster {
        width: 160px;
        height: 240px;
    }
}

.loading {
    position: relative;
    opacity: 0.7;
}

.loading::after {
    content: "🎬";
    position: absolute;
    right: 10px;
    bottom: 10px;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.username {
    font-weight: 600;
    color: #4299e1;
}

.feedback-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.feedback-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    color: #4a5568;
}

.feedback-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: none;
}

.feedback-btn.active {
    opacity: 1;
    color: #4299e1;
}

.feedback-btn.dislike.active {
    color: #e53e3e;
}
