/**
 * PANDAYA - Main Stylesheet
 * AI Live Commerce Platform
 */

/* ================================
   Variables & Root
   ================================ */
:root {
    --primary-color: #FF6B35;
    --primary-dark: #e55a2b;
    --secondary-color: #004E89;
    --accent-color: #FFB700;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #1A1A2E;
    --light-color: #F5F5F5;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-500: #adb5bd;
    --gray-700: #495057;
    --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --border-radius: 8px;
    --transition: all 0.2s ease;
}

/* ================================
   Base Styles
   ================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--gray-700);
    background-color: var(--light-color);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ================================
   Buttons
   ================================ */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

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

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

/* ================================
   Cards
   ================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

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

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ================================
   Broadcast Cards
   ================================ */
.broadcast-card {
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.broadcast-thumbnail {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

.broadcast-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewer-count {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

/* ================================
   Live Badge
   ================================ */
.live-badge {
    display: inline-block;
    background: #ff0000;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ================================
   Forms
   ================================ */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
}

/* ================================
   Navigation
   ================================ */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 500;
}

/* ================================
   Hero Section
   ================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FF8C42 100%);
    color: white;
    padding: 4rem 0;
}

.hero-section h1 {
    font-weight: 700;
    font-size: 2.5rem;
}

/* ================================
   Price Styles
   ================================ */
.price-original {
    text-decoration: line-through;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.price-sale {
    color: var(--danger-color);
    font-weight: 700;
}

.discount-badge {
    background: var(--danger-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chat-message .nickname {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.chat-message .content {
    color: var(--gray-700);
    word-wrap: break-word;
}

.chat-message.system {
    background: #e3f2fd;
    text-align: center;
    color: var(--info-color);
}

.chat-message.purchase {
    background: #fff3cd;
    border-left: 3px solid var(--warning-color);
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    background: white;
}

/* ================================
   Loading & Animations
   ================================ */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.loading::after {
    content: "";
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

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

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }

    .product-card img {
        height: 150px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

/* ================================
   Utilities
   ================================ */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
