/* ===== 네이버 쇼핑라이브 스타일 ===== */

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

:root {
    --primary: #03c75a;
    --primary-dark: #02b350;
    --secondary: #222;
    --text: #222;
    --text-light: #666;
    --text-muted: #999;
    --bg: #f5f6f8;
    --white: #fff;
    --border: #e5e5e5;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    vertical-align: middle;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Header ===== */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 16px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo::before {
    content: "";
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, #00a648 100%);
    border-radius: 8px;
    flex-shrink: 0;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav a {
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-light);
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

.nav a:hover {
    color: var(--primary);
    background: rgba(3, 199, 90, 0.08);
}

.nav .btn {
    margin-left: 4px;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.menu-toggle:hover {
    background: var(--bg);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: all 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-content {
    background: var(--white);
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.mobile-nav-content a {
    display: block;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text);
    border-radius: 8px;
    margin-bottom: 4px;
}

.mobile-nav-content a:hover {
    background: var(--bg);
    color: var(--primary);
}

.mobile-nav-content .divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-outline {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ===== Main ===== */
.main {
    padding: 24px 0;
    min-height: calc(100vh - 56px);
}

/* ===== Section Title ===== */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .more {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Live Grid ===== */
.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.live-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.live-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.live-thumbnail {
    position: relative;
    aspect-ratio: 9/12;
    background: #000;
    overflow: hidden;
}

.live-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #ff0050;
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.live-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--white);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.live-badge.scheduled {
    background: var(--secondary);
}

.live-badge.scheduled::before {
    display: none;
}

.live-badge.ended {
    background: var(--text-muted);
}

.live-badge.ended::before {
    display: none;
}

.live-viewers {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-viewers::before {
    content: "👁";
    font-size: 10px;
}

.live-info {
    padding: 14px;
}

.live-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.live-seller {
    font-size: 13px;
    color: var(--text-muted);
}

.live-products {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow: hidden;
}

.live-products img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* ===== Watch Page ===== */
.watch-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.video-area {
    position: relative;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}

.video-player {
    aspect-ratio: 9/16;
    max-height: 80vh;
    margin: 0 auto;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.video-live-badge {
    background: #ff0050;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-live-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--white);
    border-radius: 50%;
    animation: blink 1s infinite;
}

.video-viewers {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Sidebar ===== */
.sidebar-panel {
    background: var(--white);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    height: 80vh;
    max-height: 800px;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.sidebar-tab {
    flex: 1;
    padding: 14px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.sidebar-tab.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

.sidebar-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== Chat ===== */
.chat-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.chat-message {
    margin-bottom: 12px;
    font-size: 14px;
}

.chat-message-user {
    font-weight: 600;
    color: var(--primary);
    margin-right: 8px;
}

.chat-message-text {
    color: var(--text);
    word-break: break-word;
}

.chat-message-cn {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

.chat-input-wrap {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.chat-input:focus {
    border-color: var(--primary);
}

/* ===== Products Panel ===== */
.products-panel {
    padding: 16px;
    overflow-y: auto;
}

.product-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.product-item-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg);
}

.product-item-info {
    flex: 1;
}

.product-item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

/* ===== Subtitle ===== */
.subtitle-container {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 20px;
    pointer-events: none;
}

.subtitle-text {
    display: inline-block;
    background: rgba(0,0,0,0.8);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    line-height: 1.5;
    max-width: 90%;
}

.subtitle-cn {
    color: #ffd700;
    margin-top: 6px;
    font-size: 15px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== Cards ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ===== Auth Page ===== */
.auth-container {
    max-width: 400px;
    margin: 40px auto;
}

.auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
}

.auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* ===== Dashboard ===== */
.dashboard {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
}

.sidebar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 76px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.15s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--bg);
    color: var(--primary);
    font-weight: 600;
}

.dashboard-content {
    min-height: 500px;
}

/* ===== Broadcast Page ===== */
.broadcast-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.broadcast-preview {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.broadcast-preview video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.broadcast-controls {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.status-live {
    background: #ff0050;
    color: var(--white);
}

.status-ready {
    background: var(--bg);
    color: var(--text-muted);
}

/* ===== Product Grid ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-image {
    aspect-ratio: 1;
    background: var(--bg);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 14px;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
}

.product-seller {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== Footer ===== */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 40px;
}

.footer-inner {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .watch-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-panel {
        height: 400px;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .broadcast-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Mobile Header */
    .header-inner {
        height: 54px;
    }

    .nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .mobile-nav {
        display: block;
    }

    .logo {
        font-size: 16px;
    }

    .logo::before {
        width: 26px;
        height: 26px;
    }

    /* Mobile Main */
    .main {
        padding: 16px 0;
    }

    .container {
        padding: 0 12px;
    }

    /* Mobile Section */
    .section-title h2 {
        font-size: 16px;
    }

    /* Mobile Auth */
    .auth-container {
        margin: 20px auto;
        padding: 0 12px;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .auth-title {
        font-size: 20px;
        margin-bottom: 24px;
    }
}

@media (max-width: 600px) {
    .live-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .live-thumbnail {
        aspect-ratio: 9/12;
    }

    .live-badge {
        top: 8px;
        left: 8px;
        padding: 3px 6px;
        font-size: 10px;
    }

    .live-badge::before {
        width: 5px;
        height: 5px;
    }

    .live-viewers {
        bottom: 8px;
        left: 8px;
        padding: 3px 6px;
        font-size: 10px;
    }

    .live-info {
        padding: 10px;
    }

    .live-title {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .live-seller {
        font-size: 11px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .product-price {
        font-size: 14px;
    }

    .product-seller {
        font-size: 11px;
    }

    /* Mobile Footer */
    .footer {
        padding: 20px 0;
        margin-top: 24px;
    }
}

@media (max-width: 400px) {
    .logo::before {
        display: none;
    }
}
