/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.top-header {
    background: linear-gradient(135deg, #d15014 0%, #b83726 100%);
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.top-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo img {
    height: 40px;
    width: auto;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.main-nav a:hover {
    opacity: 0.8;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #ff6b6b;
    color: white;
}

.btn-primary:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: #d15014;
}

/* Bottom Header with Statistics */
.bottom-header {
    background-color: white;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #d15014;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content */
.main-content {
    padding: 20px 0;
}

/* Ad Banner */
.ad-banner {
    text-align: center;
    margin-bottom: 25px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ad-banner img {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
}

/* Tab Navigation */
.tab-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 5px;
    margin-bottom: 20px;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    border: none;
    background-color: #f8f9fa;
    color: #6c757d;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    background: linear-gradient(135deg, #d15014 0%, #d15014 100%);
    color: white;
}

/* Tab Content */
.tab-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.content-header {
    margin-bottom: 25px;
    text-align: center;
}

.content-header h2 {
    color: #333;
    margin-bottom: 8px;
    font-size: 2rem;
}

.content-header p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* Website Grid */
.website-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.website-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e9ecef;
}

.website-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.website-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 15px;
}

.card-content h3 {
    margin-bottom: 8px;
    color: #333;
    font-size: 1.2rem;
}

.card-content p {
    color: #6c757d;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.visitors {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

/* Footer */
.footer {
    background-color: #343a40;
    color: white;
    padding: 30px 0 15px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.footer-section h4 {
    margin-bottom: 15px;
    color: #fff;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .main-nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .tab-navigation {
        justify-content: center;
    }

    .tab-btn {
        min-width: 100px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .website-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .content-header h2 {
        font-size: 1.5rem;
    }

    .content-header p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        min-width: 80px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .website-grid {
        grid-template-columns: 1fr;
    }

    .tab-content {
        padding: 15px;
    }

    .user-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Loading Animation for Stats */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-item {
    animation: countUp 0.6s ease-out;
}

/* Banner Styles */
.banners {
    padding-bottom: 10px;
}

.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 5px;
    justify-items: center;
}

.banner-item {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.banner-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Responsive Banner Styles */
@media (max-width: 1200px) {
    .banner-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 968px) {
    .banner-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
    }
    
    .banner-item {
        max-height: 100px;
    }
}

@media (max-width: 768px) {
    .banners {
        padding: 15px 0;
        margin-bottom: 25px;
    }
    
    .banner-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .banner-item {
        max-height: 80px;
    }
}

@media (max-width: 576px) {
    .banners {
        padding: 10px 0;
        margin-bottom: 20px;
    }
    
    .banner-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .banner-item {
        max-height: 100px;
    }
}

@media (max-width: 400px) {
    .banner-grid {
        max-width: 280px;
    }
    
    .banner-item {
        max-height: 80px;
    }
}

/* Korean Socials Section */
.korean-socials {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.korean-socials::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d15014, #ff6b6b, #4285f4, #ea4335, #fbbc05, #34a853);
    border-radius: 16px 16px 0 0;
}

.section-header {
    text-align: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-title i {
    color: #d15014;
    font-size: 1.8rem;
}

.section-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    font-weight: 400;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.social-category {
    background: rgba(255,255,255,0.7);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.social-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.category-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #d15014, #ff6b6b);
    border-radius: 2px;
}

.social-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    justify-items: center;
}

.social-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

.social-icon:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.8);
}

.icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.social-icon:hover .icon-wrapper {
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.icon-wrapper img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.icon-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    text-align: center;
    transition: all 0.3s ease;
}

.social-icon:hover .icon-label {
    color: #d15014;
    font-weight: 600;
}

/* Specific brand colors on hover */
.social-icon.google:hover .icon-wrapper {
    background: linear-gradient(135deg, #4285f4, #34a853);
}

.social-icon.naver:hover .icon-wrapper {
    background: linear-gradient(135deg, #03c75a, #05b350);
}

.social-icon.daum:hover .icon-wrapper {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.social-icon.youtube:hover .icon-wrapper {
    background: linear-gradient(135deg, #ff0000, #cc0000);
}

.social-icon.instagram:hover .icon-wrapper {
    background: linear-gradient(135deg, #e4405f, #833ab4, #fd5949);
}

.social-icon.facebook:hover .icon-wrapper {
    background: linear-gradient(135deg, #1877f2, #42a5f5);
}

.social-icon.twitter:hover .icon-wrapper {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
}

/* Responsive Design */
@media (max-width: 768px) {
    .korean-socials {
        padding: 20px;
        margin: 20px 0;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .social-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .social-category {
        padding: 20px;
    }
    
    .social-icons {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 12px;
    }
    
    .icon-wrapper {
        width: 45px;
        height: 45px;
    }
    
    .icon-wrapper img {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .korean-socials {
        padding: 15px;
        border-radius: 12px;
    }
    
    .section-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .section-title i {
        font-size: 1.5rem;
    }
    
    .social-icons {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .icon-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .icon-wrapper img {
        width: 24px;
        height: 24px;
    }
    
    .icon-label {
        font-size: 0.8rem;
    }
}
.category-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.category-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d15014 0%, #d15014 50%, #ff6b6b 100%);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-title h3 {
    margin: 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
}

.category-count {
    background: linear-gradient(135deg, #d15014 0%, #d15014 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.category-more {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #d15014;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #d15014;
    transition: all 0.3s ease;
    background: white;
}

.category-more:hover {
    background: #d15014;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.site-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #f1f3f4;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #d15014 0%, #d15014 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.site-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.site-card:hover::before {
    transform: scaleY(1);
}

.site-rank {
    flex-shrink: 0;
}

.rank-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.site-info {
    flex: 1;
    min-width: 0;
}

.site-link {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    text-decoration: none;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.site-link:hover {
    color: #d15014;
}

.site-link.premium {
    color: #ff6b6b;
    position: relative;
}

.site-link.premium::after {
    content: '★';
    color: #ffc107;
    margin-left: 5px;
    font-size: 0.9rem;
}

.site-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.site-status {
    font-size: 0.8rem;
}

.site-status.online {
    color: #28a745;
}

.site-status.offline {
    color: #dc3545;
}

.site-visitors {
    color: #6c757d;
    font-weight: 500;
}

.site-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.bookmark-site,
.share-site {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.bookmark-site:hover {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.share-site:hover {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Responsive adjustments for category section */
@media (max-width: 768px) {
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .category-title {
        flex-wrap: wrap;
    }

    .sites-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .site-card {
        padding: 12px;
        gap: 12px;
    }

    .category-title h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .category-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .site-card {
        padding: 10px;
        gap: 10px;
    }

    .rank-img {
        width: 35px;
        height: 35px;
    }

    .site-link {
        font-size: 1rem;
    }

    .site-actions {
        flex-direction: column;
        gap: 6px;
    }

    .bookmark-site,
    .share-site {
        width: 28px;
        height: 28px;
    }
}

/* Smooth Transitions */
.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #d15014 0%, #b83726 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(209, 80, 20, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #b83726 0%, #a02f22 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(209, 80, 20, 0.4);
}

.back-to-top:active {
    transform: translateY(-1px);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 16px;
    }
}
/* Popup System */
.popup_wrap {
    position: relative;
    z-index: 9999;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Show by default, will be hidden by JavaScript if needed */
}

.popup_5,
.popup_7,
.popup_9 {
    position: relative;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    max-width: 90vw;
    max-height: 90vh;
    animation: popupFadeIn 0.3s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.popup_5 img,
.popup_7 img,
.popup_9 img {
    display: block;
    max-width: 100%;
    height: auto;
}

.popup .close {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.popup .close label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.popup .close label input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
    cursor: pointer;
}

.popup .close .close-btn {
    background: var(--accent-color);
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.popup .close .close-btn:hover {
    background: #dc2626;
}

/* Popup responsive */
@media (max-width: 768px) {
    .popup_5,
    .popup_7,
    .popup_9 {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .popup .close {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .popup .close label {
        justify-content: center;
    }
}

/* Animation for popup close */
.popup.closing {
    animation: popupFadeOut 0.3s ease-in;
}

@keyframes popupFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}