:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #10b981;
    --danger: #ef4444;
    --background: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

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

/* --- LOGIN PAGE --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.login-card h1 {
    color: var(--primary);
    margin-bottom: 20px;
}

/* --- MAIN LAYOUT --- */
.header {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8em;
    color: var(--primary);
}

.user-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.user-controls .btn-secondary {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 1.4em;
}

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

/* --- STATS & FILTERS --- */
.controls-bar {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
}

select {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
}

/* --- GRID --- */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.item-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    position: relative;
    cursor: pointer;
}

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

.item-poster {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #ddd;
}

.no-cover {
    width: 100%;
    height: 180px;
    background: #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

.item-content {
    padding: 15px;
}

.item-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    display: flex;
    gap: 5px;
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.card-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.badge {
    padding: 4px 10px;
    border-radius: 8px;
    background: #f3f4f6;
    font-weight: 500;
}

.badge-age {
    background: #fef3c7;
    color: #d97706;
}

/* --- STATUS BADGES --- */
.status-todo {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    color: #92400e !important;
    border: 1px solid #fcd34d !important;
}

.status-doing {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
    color: #075985 !important;
    border: 1px solid #7dd3fc !important;
}

.status-done {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #166534 !important;
    border: 1px solid #86efac !important;
}

/* --- BRANIDED PLATFORMS --- */
.badge-netflix {
    background: #E50914 !important;
    color: white !important;
}

.badge-prime {
    background: #00A8E1 !important;
    color: white !important;
}

.badge-disney {
    background: #006E99 !important;
    color: white !important;
}

.badge-apple {
    background: #000 !important;
    color: white !important;
}

.badge-paramount {
    background: #0064FF !important;
    color: white !important;
}

.badge-youtube {
    background: #FF0000 !important;
    color: white !important;
}

/* --- ICON STYLES --- */
.item-poster-container {
    position: relative;
    overflow: hidden;
}

.item-lens {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.item-lens:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* --- FORM ELEMENTS --- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
}

/* --- UTILS --- */
.hidden {
    display: none !important;
}

.preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 10px;
    margin-top: 10px;
    cursor: zoom-in;
    background: #eee;
}

/* --- LIGHTBOX --- */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.2s;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.lightbox.active img {
    transform: scale(1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- TOAST --- */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    z-index: 2000;
    transform: translateY(100px);
    transition: transform 0.3s;
}

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

/* --- HELP SYSTEM --- */
.help-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.help-icon:hover {
    transform: scale(1.1);
    background: var(--secondary);
}

.help-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--primary);
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.help-content p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.help-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.help-content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .header>div {
        justify-content: center;
        display: flex;
        width: 100%;
    }

    .user-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    #welcomeMsg {
        width: 100%;
        margin-bottom: 0;
        font-weight: 700;
        font-size: 1.1em;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input,
    select,
    .btn-primary {
        width: 100%;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .item-poster {
        height: 150px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
        border-radius: 15px;
    }
}

/* --- FOOTER --- */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    font-weight: 400;
}

.tagline {
    font-size: 0.55em;
    color: var(--text-secondary);
    display: block;
    font-weight: 400;
    margin-top: 2px;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* --- SETTINGS SECTIONS --- */
.settings-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 1em;
    margin-bottom: 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section p {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}