* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Season Selector */
.season-selector {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}

.season-selector .container {
    display: flex;
    gap: 15px;
    align-items: center;
}

.season-dropdown {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    min-width: 250px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Anime Grid */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

@media (min-width: 768px) {
    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.anime-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.anime-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.anime-card.hidden {
    opacity: 0.3;
}

.anime-card.dragging {
    opacity: 0.5;
}

.anime-card.drag-over {
    border: 2px dashed #3498db;
}

.anime-poster {
    width: 100%;
    aspect-ratio: 7/10;
    object-fit: cover;
    background: #f0f0f0;
}

.anime-info {
    padding: 15px;
}

.anime-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.anime-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tag {
    background: #ecf0f1;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    color: #555;
}

.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.hide-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 2;
}

.bookmark-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #95a5a6;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.3s;
    z-index: 2;
}

.bookmark-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.bookmark-btn.active {
    color: #f39c12;
    background: rgba(255, 255, 255, 1);
}

.anime-card.bookmarked {
    border: 2px solid #f39c12;
}

.countdown-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(52, 152, 219, 0.95);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 1;
}

.anime-card.edit-mode .hide-btn {
    display: flex;
    right: 45px;
}

.anime-card.edit-mode .bookmark-btn {
    right: 10px;
}

.anime-subtitle {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-style: italic;
}

.anime-synopsis-short {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    margin: 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.external-links {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
}

.external-links a {
    color: #3498db;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: color 0.2s;
}

.external-links a:hover {
    color: #2980b9;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 10px;
}

.info-text {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background: #fadbd8;
    border-radius: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.username {
    font-weight: 600;
}
