/* ==================== VARIABLES ====================*/
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg: #0f172a;
    --bg-light: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== HEADER ====================*/
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1em;
    opacity: 0.95;
}

/* ==================== SEARCH SECTION ====================*/
.search-section {
    margin-bottom: 40px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

#searchInput {
    flex: 1;
    min-width: 250px;
    padding: 15px 20px;
    background-color: var(--bg-light);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

#searchBtn, .btn-primary, .btn-secondary, .btn-refresh {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#searchBtn, .btn-primary {
    background-color: var(--primary);
    color: white;
}

#searchBtn:hover, .btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

#searchBtn:active, .btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--border);
}

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

.btn-refresh:hover {
    background-color: #059669;
}

.message {
    min-height: 20px;
    font-size: 0.95em;
    text-align: center;
}

.message.info {
    color: var(--primary);
}

.message.success {
    color: var(--success);
}

.message.error {
    color: var(--error);
}

.message.warning {
    color: var(--warning);
}

/* ==================== RESULTS ====================*/
.results-section {
    margin-bottom: 40px;
}

.results-section h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.result-item {
    background-color: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.result-item:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.result-item p {
    color: var(--text-muted);
    font-size: 0.95em;
    margin-bottom: 10px;
}

/* ==================== ANIME CARD ====================*/
.details-section {
    margin-bottom: 40px;
}

.anime-card {
    background-color: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.anime-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.anime-image {
    width: 200px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.anime-info {
    flex: 1;
    min-width: 250px;
}

.anime-info h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

.anime-metadata {
    background-color: rgba(99, 102, 241, 0.1);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.anime-metadata p {
    margin-bottom: 10px;
    font-size: 1em;
}

.anime-synopsis {
    background-color: rgba(99, 102, 241, 0.05);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--secondary);
}

.anime-synopsis h3 {
    margin-bottom: 10px;
    color: var(--secondary);
}

.anime-synopsis p {
    line-height: 1.8;
    color: var(--text-muted);
}

/* ==================== DOWNLOAD SECTION ====================*/
.download-section {
    background-color: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.download-section h3 {
    margin-bottom: 20px;
}

.episode-input {
    margin-bottom: 20px;
}

.episode-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.range-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.range-inputs input {
    flex: 1;
    min-width: 100px;
    padding: 12px;
    background-color: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
}

.range-inputs input:focus {
    outline: none;
    border-color: var(--primary);
}

.range-inputs span {
    color: var(--text-muted);
    font-weight: 600;
}

.download-section > button {
    margin-right: 10px;
    margin-top: 10px;
}

/* ==================== PROGRESS SECTION ====================*/
.progress-section {
    background-color: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.progress-info {
    margin-top: 20px;
}

#progressMessage {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: var(--primary);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background-color: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

#progressPercent {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

/* ==================== FILES SECTION ====================*/
.files-section {
    background-color: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.files-section h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.files-list {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.file-item {
    background-color: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.1);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.9em;
}

.file-actions {
    display: flex;
    gap: 10px;
    margin-left: 15px;
}

.btn-download, .btn-delete {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.btn-download:hover {
    background-color: #059669;
}

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

.btn-delete:hover {
    background-color: #dc2626;
}

/* ==================== FOOTER ====================*/
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ==================== RESPONSIVE ====================*/
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .search-box {
        flex-direction: column;
    }

    #searchInput {
        min-width: 100%;
    }

    .anime-header {
        flex-direction: column;
        align-items: center;
    }

    .anime-image {
        width: 150px;
        height: 225px;
    }

    .anime-info {
        text-align: center;
    }

    .file-item {
        flex-direction: column;
        gap: 15px;
    }

    .file-actions {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .anime-card, .download-section, .progress-section, .files-section {
        padding: 15px;
    }

    .range-inputs {
        flex-wrap: wrap;
    }

    .range-inputs input {
        min-width: 80px;
    }
}
