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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

.site-header {
    background: #1a1a1a;
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.logo a {
    color: #e74c3c;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
}

.main-nav .active a,
.main-nav a:hover {
    background: #e74c3c;
}

.search-box {
    display: flex;
    min-width: 300px;
}

.search-box input {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.search-box button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.user-actions button {
    background: #333;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.user-actions button:hover {
    background: #555;
}

.mobile-header {
    display: none;
    background: #1a1a1a;
    color: white;
}

.mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.mobile-logo a {
    color: #e74c3c;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
}

.mobile-actions {
    display: flex;
    gap: 10px;
}

.mobile-actions button {
    background: #333;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.mobile-search {
    padding: 0 20px 15px;
    display: none;
}

.mobile-search form {
    display: flex;
}

.mobile-search input {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.mobile-search button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    background: #333;
    padding: 10px 20px;
}

.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.mobile-nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 14px;
}

.mobile-nav .active a,
.mobile-nav a:hover {
    background: #e74c3c;
}

.main-content {
    padding: 30px 0;
}

.hero-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.hero-content h1 {
    font-size: 24px;
    color: #333;
}

.refresh-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #c0392b;
}

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

.movie-item {
    text-align: center;
}

.movie-poster {
    position: relative;
    margin-bottom: 10px;
}

.movie-poster a {
    display: block;
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
}

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

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

.status {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.movie-info h3 {
    margin-bottom: 5px;
    font-size: 14px;
}

.movie-info h3 a {
    color: #333;
    text-decoration: none;
}

.movie-info h3 a:hover {
    color: #e74c3c;
}

.movie-info p {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.content-section {
    margin-bottom: 30px;
}

.section-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.main-content-area {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-section {
    margin-bottom: 40px;
}

.category-section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e74c3c;
}

.section-header h2 {
    font-size: 22px;
    color: #333;
}

.more-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.more-link:hover {
    color: #e74c3c;
}

.sidebar {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: fit-content;
}

.ranking-section {
    margin-bottom: 30px;
}

.section-header h3 {
    font-size: 18px;
    color: #333;
}

.featured-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.rank-poster {
    position: relative;
    width: 80px;
    height: 100px;
    flex-shrink: 0;
}

.rank-poster a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    overflow: hidden;
}

.rank-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #e74c3c;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.rank-info {
    flex: 1;
}

.rank-info h4 {
    margin-bottom: 8px;
    font-size: 14px;
}

.rank-info h4 a {
    color: #333;
    text-decoration: none;
}

.rank-info h4 a:hover {
    color: #e74c3c;
}

.rank-info p {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.ranking-list {
    list-style: none;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-num {
    width: 20px;
    height: 20px;
    background: #666;
    color: white;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 10px;
    flex-shrink: 0;
}

.rank-item:nth-child(-n+3) .rank-num {
    background: #e74c3c;
}

.rank-item a {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    margin-right: 10px;
}

.rank-item a:hover {
    color: #e74c3c;
}

.rank-item .status {
    position: static;
    background: #f0f0f0;
    color: #666;
    font-size: 11px;
    padding: 2px 6px;
}

.links-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.links-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.links-content a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.links-content a:hover {
    color: #e74c3c;
}

.site-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0;
    margin-top: 50px;
}

.footer-content {
    text-align: center;
    color: #bdc3c7;
    font-size: 14px;
    line-height: 1.8;
}

.footer-content p {
    margin-bottom: 10px;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
    font-size: 18px;
    font-weight: bold;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #c0392b;
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .site-header {
        display: none;
    }
    
    .mobile-header {
        display: block;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .section-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        order: -1;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .hero-section,
    .main-content-area,
    .sidebar,
    .links-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .mobile-top {
        padding: 12px 15px;
    }
    
    .mobile-search {
        padding: 0 15px 12px;
    }
    
    .mobile-nav {
        padding: 8px 15px;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .footer-content {
        font-size: 13px;
    }
}

.mobile-menu-active .mobile-nav {
    display: block;
}

.mobile-search-active .mobile-search {
    display: block;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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