:root {
    --primary: #ff4757;
    --dark: #1e272e;
    --darker: #121619;
    --glass: rgba(30, 39, 46, 0.95);
    --text: #f1f2f6;
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--darker);
    color: var(--text);
}

.container { width: 90%; max-width: 1400px; margin: auto; }
.hidden { display: none !important; }

/* Header */
header {
    background: var(--dark);
    padding: 1rem 0;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.logo { margin: 0; cursor: pointer; color: white; }
.logo span { color: var(--primary); }

.search-box input {
    background: #2f3542;
    border: 1px solid #57606f;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    width: 250px;
    outline: none;
    transition: 0.3s;
}
.search-box input:focus { border-color: var(--primary); width: 300px; }

/* Grid */
.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 30px 0;
}

.manga-card {
    background: var(--dark);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}
.manga-card:hover { transform: translateY(-7px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.manga-card img { width: 100%; height: 240px; object-fit: cover; }
.manga-card h3 { 
    font-size: 0.9rem; padding: 12px; margin: 0; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}

/* Load More & Spinner */
.actions { text-align: center; padding-bottom: 40px; }
button {
    background: var(--primary); color: white; border: none;
    padding: 10px 25px; border-radius: 5px; cursor: pointer; font-size: 1rem;
}
button:hover { background: #ff6b81; }

.spinner {
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--primary);
    border-radius: 50%; width: 40px; height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Reader Modal */
.modal {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; z-index: 100;
    background: black;
}

.modal-header {
    position: absolute; top: 0; width: 100%; height: 70px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px; box-sizing: border-box; z-index: 101;
}

.modal-title { display: flex; align-items: center; gap: 15px; overflow: hidden; }
.modal-title h2 { font-size: 1.1rem; margin: 0; white-space: nowrap; }
select { padding: 5px; border-radius: 4px; background: #2f3542; color: white; border: 1px solid #57606f; max-width: 150px; }

.modal-body {
    height: 100%; padding-top: 80px; box-sizing: border-box;
    overflow-y: auto; text-align: center;
}
.modal-body img { max-width: 100%; display: block; margin: 0 auto; }
