:root {
    --bg-dark: #0a0a0c;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.glow-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Header Styles */
header {
    padding: 1.5rem 5%;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    -webkit-text-fill-color: initial;
    color: #8b5cf6;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.hero h1 span {
    background: var(--gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    border-radius: 100px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    background: var(--bg-card-hover);
}

.search-icon {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

input#movie-search {
    flex: 1;
    background: none;
    border: none;
    color: white;
    padding: 1rem;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
}

button#search-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button#search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(236, 72, 153, 0.4);
}

/* Section Styles */
.section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.count {
    background: var(--bg-card);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

/* Result Card */
.result-card-container {
    display: flex;
    justify-content: center;
}

.movie-card.featured {
    display: grid;
    grid-template-columns: 300px 1fr;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    max-width: 900px;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .movie-card.featured {
        grid-template-columns: 1fr;
    }
}

.card-image {
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.rating {
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #fbbf24;
    backdrop-filter: blur(5px);
}

.card-info {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-info h3 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.genre {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.add-btn {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: white;
    color: black;
    transform: scale(1.05);
}

/* Movie Grid (Mini Cards) */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
}

.movie-card.mini {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.movie-card.mini:hover {
    transform: translateY(-10px);
    background: var(--bg-card-hover);
    border-color: var(--accent);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

.movie-card.mini .card-image {
    height: 320px;
}

.remove-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.movie-card.mini:hover .remove-btn {
    opacity: 1;
}

.movie-card.mini .card-info {
    padding: 1.25rem;
}

.movie-card.mini h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.mini-rating {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
    backdrop-filter: blur(4px);
}

.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px dashed var(--glass-border);
}

/* Fix background-clip */
.logo,
.hero h1 span,
button#search-btn {
    background-clip: text;
    -webkit-background-clip: text;
}

button#search-btn {
    background-clip: padding-box;
    /* Reset for button */
    -webkit-background-clip: padding-box;
}

/* Terminé Status */
.movie-card.finished {
    border-color: #22c55e;
    position: relative;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
}

.finished-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #22c55e;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
}

.user-review {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.user-score {
    color: #fbbf24;
    font-weight: 800;
    font-size: 0.9rem;
}

.user-comment {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.finish-btn {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    width: 100%;
    transition: all 0.3s ease;
}

.finish-btn:hover {
    background: #22c55e;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-family: inherit;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions button {
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.save-btn {
    background: var(--gradient);
    color: white;
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Search Results Grid */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.search-item {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlay-simple {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
    z-index: 2;
}

.add-btn-small {
    width: 100%;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    transition: all 0.3s ease;
}

.add-btn-small:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.add-btn-small i {
    width: 14px;
    height: 14px;
}

/* Heartbeat animation for a romantic touch */
@keyframes heartPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.logo i {
    animation: heartPulse 2s infinite ease-in-out;
    color: #ec4899;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    font-size: 0.9rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .search-wrapper {
        flex-direction: column;
        border-radius: 20px;
        padding: 1rem;
    }

    button#search-btn {
        width: 100%;
    }

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

    .movie-grid,
    .search-results-grid {
        grid-template-columns: 1fr;
    }

    .search-results-grid {
        gap: 1rem;
    }
}