/* Design System & Custom Tokens */
:root {
    --bg-gradient-start: #0f0c1b;
    --bg-gradient-end: #05050e;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.06);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --success-color: #10b981; /* Emerald */
    --accent-color: #a855f7; /* Purple */
    --danger-color: #ef4444; /* Red */
    --glow-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 2rem;
    overflow-x: hidden;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.4));
}

.logo h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo h1 span {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Search Box */
.search-section {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.6s ease-out;
}

.search-box {
    width: 100%;
    max-width: 700px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--glow-shadow), 0 4px 30px rgba(0, 0, 0, 0.4);
}

.search-icon {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-right: 1rem;
}

#search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.1rem;
    width: 100%;
}

#search-input::placeholder {
    color: #64748b;
}

#search-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    outline: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: var(--transition-smooth);
}

#search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

#search-btn:active {
    transform: translateY(0);
}

/* Loading Spinner */
.loading-container {
    text-align: center;
    margin: 4rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.loading-container p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Grid & Cards */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.8s ease-out;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 480px;
    transition: var(--transition-smooth);
    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Badge (Movie / TV) */
.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.35rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.badge.movie {
    background: linear-gradient(135deg, #f59e0b, #d97706); /* Amber */
    color: #fff;
}

.badge.series {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
}

/* Poster */
.poster-wrapper {
    height: 300px;
    position: relative;
    overflow: hidden;
    background: #1e1b4b;
}

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

.card:hover .poster-img {
    transform: scale(1.05);
}

.no-poster {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #475569;
    gap: 0.5rem;
}

.no-poster i {
    font-size: 3rem;
}

/* Card Content */
.card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.card-title-row {
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-year {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.card-overview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

/* Action Buttons */
.action-btn {
    width: 100%;
    border: none;
    outline: none;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

/* Add / Request */
.btn-add {
    background: rgba(99, 102, 241, 0.1);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-add:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Status Badges */
.btn-status-added {
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
    cursor: default;
}

.btn-status-downloaded {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    cursor: default;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

.empty-icon {
    font-size: 3.5rem;
    color: #475569;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-secondary);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--card-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(12px);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

/* Utility classes */
.hidden {
    display: none !important;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

