/* ========================================
   YouTube 스타일 - 모바일 전용 CSS (mTop.php)
   기존 mTop.php의 스타일을 YouTube 스타일로 변환
   ======================================== */

/* 기본 body 스타일 */
body {
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    color: #D0D0D0;
    background: var(--yt-dark-bg, #0F0F0F);
    padding-top: 60px;
    padding-bottom: 60px;
    opacity: 0;
    transition: opacity 0.3s ease-in;
    margin: 0;
}

body.loaded {
    opacity: 1;
}

/* 상단 헤더 */
.main {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 60px;
    background: rgba(15, 15, 15, 0.95);
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--yt-border, #3A3A3A);
}

.main-left,
.main-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.main-center {
    flex: 1;
    max-width: 250px;
    margin: 0 0.5rem;
}

/* 검색 폼 */
.search-form {
    width: 100%;
    display: flex;
    gap: 0.3rem;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--yt-border, #3A3A3A);
    border-radius: 20px;
    font-size: 0.95rem;
    min-width: 0;
    background: var(--yt-hover-bg, #3A3A3A);
    color: var(--yt-text-primary, #F1F1F1);
    transition: all 0.2s;
}

.search-form input[type="text"]::placeholder {
    color: var(--yt-text-disabled, #717171);
}

.search-form input[type="text"]:focus {
    outline: none;
    border-color: var(--yt-blue, #3EA6FF);
    background: var(--yt-card-bg, #212121);
}

.search-form button {
    padding: 0.5rem 0.9rem;
    background: var(--yt-hover-bg, #3A3A3A);
    color: var(--yt-text-primary, #F1F1F1);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.search-form button:hover {
    background: var(--yt-border, #3A3A3A);
}

/* 로그인 영역 */
.mlogin {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.mlogin span {
    color: #D0D0D0;
    font-size: 0.95rem;
    font-weight: 400;
}

.mlogin a {
    color: #D0D0D0;
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border-radius: 20px;
    transition: background-color 0.2s;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--yt-hover-bg, #3A3A3A);
}

.mlogin a:hover {
    background-color: var(--yt-border, #404040);
}

/* 관리자 링크 */
.admin-link {
    color: var(--yt-red, #FF0000) !important;
    margin-right: 0.3rem;
    padding: 0.4rem !important;
    border-radius: 50% !important;
    background-color: rgba(255, 0, 0, 0.15) !important;
    font-size: 1rem !important;
}

.admin-link:hover {
    background-color: rgba(255, 0, 0, 0.25) !important;
    color: var(--yt-red-hover, #CC0000) !important;
}

.admin-link i {
    font-size: 0.95rem;
}

/* 홈 링크 */
.home-link {
    color: #D0D0D0;
    text-decoration: none;
    padding: 0.6rem;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-link:hover {
    background-color: var(--yt-hover-bg, #3A3A3A);
}

.home-link i {
    font-size: 1.4rem;
}

/* 하단 네비게이션 */
.bottom-nav {
    width: 100%;
    max-width: 100%;
    height: auto;
    background: rgba(15, 15, 15, 0.95);
    border-radius: 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    border-top: 1px solid var(--yt-border, #3A3A3A);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #B0B0B0;
    font-size: 0.75rem;
    padding: 0.5rem;
    transition: color 0.2s;
    border-radius: 8px;
    min-width: 60px;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: #E0E0E0;
    background: var(--yt-hover-bg, #3A3A3A);
}

/* 카테고리 팝업 */
.bottom-nav-content {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 0;
    width: 100%;
    background: rgba(15, 15, 15, 0.98);
    padding: 1.5rem 1rem;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
    z-index: 999;
    max-height: 70vh;
    overflow-y: auto;
    border-top: 1px solid var(--yt-border, #3A3A3A);
}

.bottom-nav-content.active {
    display: block;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 카테고리 그리드 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    max-height: none;
    padding-bottom: 1rem;
}

.category-item {
    padding: 1.1rem;
    background: var(--yt-card-bg, #212121);
    border: 1px solid var(--yt-border, #3A3A3A);
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #D0D0D0;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
}

.category-item:hover {
    background-color: var(--yt-hover-bg, #3A3A3A);
    border-color: var(--yt-blue, #3EA6FF);
    transform: translateY(-2px);
}

/* 스크롤바 커스터마이징 */
.bottom-nav-content::-webkit-scrollbar {
    width: 6px;
}

.bottom-nav-content::-webkit-scrollbar-track {
    background: var(--yt-darker-bg, #0A0A0A);
}

.bottom-nav-content::-webkit-scrollbar-thumb {
    background: var(--yt-hover-bg, #3A3A3A);
    border-radius: 3px;
}

.bottom-nav-content::-webkit-scrollbar-thumb:hover {
    background: var(--yt-border, #404040);
}

/* 데스크톱에서 하단 네비 표시 */
@media (min-width: 768px) {
    .bottom-nav {
        display: flex;
    }
    
    .bottom-nav-content {
        display: none;
    }
    
    body {
        padding-bottom: 20px;
    }
}

/* 모바일 최적화 */
@media (max-width: 480px) {
    .main {
        padding: 0.4rem 0.6rem;
    }
    
    .main-center {
        max-width: 180px;
        margin: 0 0.3rem;
    }
    
    .mlogin {
        font-size: 0.85rem;
        gap: 0.3rem;
    }
    
    .mlogin span {
        display: none;
    }
    
    .mlogin a {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .admin-link {
        padding: 0.35rem !important;
        margin-right: 0.2rem !important;
        font-size: 0.9rem !important;
    }
    
    .search-form input[type="text"] {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
    
    .search-form button {
        padding: 0.4rem 0.7rem;
        font-size: 0.9rem;
    }
    
    .home-link i {
        font-size: 1.2rem;
    }
    
    .bottom-nav-item {
        font-size: 0.7rem;
        padding: 0.3rem;
        min-width: 50px;
    }
    
    .bottom-nav-item i {
        font-size: 1.1rem;
    }
    
    .category-grid {
        gap: 0.5rem;
    }
    
    .category-item {
        padding: 0.8rem;
        font-size: 0.85rem;
    }
}

/* 초소형 화면 */
@media (max-width: 360px) {
    .main-center {
        max-width: 150px;
    }
    
    .search-form input[type="text"] {
        font-size: 0.8rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* 로딩 스크린 (mTop.php 전용) */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--yt-dark-bg, #0F0F0F) 0%, var(--yt-darker-bg, #0A0A0A) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--yt-red, #FF0000);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--yt-text-primary, #F1F1F1);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.loading-subtext {
    color: var(--yt-text-secondary, #AAAAAA);
    font-size: 14px;
    text-align: center;
}

