/* =====================================================
   MOVE RECORDS - UNIFIED DESIGN SYSTEM v2.0
   Designed by: Watt (Art Director) + Sprite (Graphic Creator)
   Style: Premium · Glassmorphism · Modern Dashboard
   Date: 29 May 2026
   ===================================================== */

/* ===== ROOT VARIABLES ===== */
:root {
    /* Background System */
    --bg-primary: #0F1729;       /* navy เข้มหลัก */
    --bg-deeper: #0B1220;        /* น้ำเงินเข้มที่สุด */
    --bg-card: #1A2138;          /* card content */
    --bg-card-hover: #232C47;
    --bg-glass: rgba(26, 33, 56, 0.5);
    
    /* Brand Colors */
    --accent: #F59E0B;           /* gold/orange (warm) - headlines */
    --accent-light: #FBBF24;
    --accent-soft: rgba(245, 158, 11, 0.1);
    
    /* Interactive Gradient (Nav Active) */
    --gradient-active: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
    --gradient-glow: 0 4px 20px rgba(139, 92, 246, 0.4);
    
    /* Text */
    --text: #FFFFFF;
    --text-light: #B0B8D4;
    --text-dim: #6B7280;
    --text-muted: #4B5563;
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-default: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --border-accent: rgba(245, 158, 11, 0.3);
    
    /* Platform Accents (used per page/content) */
    --color-youtube: #FF0000;
    --color-spotify: #1DB954;
    --color-apple: #FA243C;
    --color-tiktok: #FE2C55;
    --color-instagram: #E4405F;
    --color-facebook: #1877F2;
    
    /* Page-specific accents */
    --color-mystic: #9D4EDD;
    --color-calendar: #00B4D8;
    --color-brand: #0066CC;
    
    /* Shadows & Effects */
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-glow-gold: 0 0 24px rgba(245, 158, 11, 0.2);
    --shadow-glow-purple: 0 0 24px rgba(139, 92, 246, 0.3);
    
    /* Animation */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
}

/* Subtle background pattern (premium feel) */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===== HEADER (UNIFIED · GLASSMORPHISM) ===== */
header.unified-header,
header {
    background: rgba(15, 23, 41, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 18px 16px 14px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 8px;
}

/* Brand centered */
.brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--accent);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 14px;
    opacity: 0.9;
    white-space: nowrap;
}

/* TABLET: Adjust brand size */
@media (max-width: 1023px) and (min-width: 768px) {
    .brand {
        font-size: 18px;
    }
}

/* MOBILE: Adjust brand size for smaller screens */
@media (max-width: 767px) {
    .brand {
        font-size: 16px;
    }
}

/* Page title - centered */
h1.page-title,
h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
    color: var(--text);
    text-align: center;
}

h1.page-title .accent,
h1 .accent {
    color: var(--accent);
    font-weight: 700;
}

.subtitle {
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 16px;
    text-align: center;
    opacity: 0.85;
}

/* ===== NAVIGATION (Purple-Blue Gradient) - RESPONSIVE 2 ROWS × 5 COLS ===== */
nav.unified-nav,
.tabs-grid,
.nav-tabs,
.nav-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 12px;
    padding: 0 4px;
}

/* DESKTOP: 2 rows × 5 columns */
@media (min-width: 1024px) {
    nav.unified-nav,
    .tabs-grid,
    .nav-tabs,
    .nav-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 12px !important;
    }
}

/* TABLET: 2 rows × 5 columns */
@media (max-width: 1023px) and (min-width: 768px) {
    nav.unified-nav,
    .tabs-grid,
    .nav-tabs,
    .nav-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 10px !important;
    }
}

/* MOBILE: 2 rows × 5 columns */
@media (max-width: 767px) {
    nav.unified-nav,
    .tabs-grid,
    .nav-tabs,
    .nav-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 8px !important;
    }
}

.nav-btn,
.tab-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 8px 6px !important;
    background: rgba(26, 33, 56, 0.6) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 8px !important;
    color: var(--text-light) !important;
    text-decoration: none !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    transition: var(--transition) !important;
    white-space: normal !important;
    word-break: break-word !important;
    position: relative !important;
    backdrop-filter: blur(8px);
    width: 100% !important;
    min-height: 45px !important;
    height: auto !important;
    line-height: 1.2 !important;
    overflow: visible !important;
    text-align: center !important;
}

/* TABLET: Adjust nav button size */
@media (max-width: 1023px) and (min-width: 768px) {
    .nav-btn,
    .tab-btn {
        padding: 4px 6px !important;
        font-size: 11px !important;
        height: 50px !important;
    }
}

/* MOBILE: Adjust nav button size for smaller screens */
@media (max-width: 767px) {
    .nav-btn,
    .tab-btn {
        padding: 4px 4px !important;
        font-size: 10px !important;
        height: 50px !important;
    }
}

.nav-btn:hover,
.tab-btn:hover {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
    color: var(--text) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.nav-btn.active,
.tab-btn.active {
    background: var(--gradient-active) !important;
    background-image: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: var(--gradient-glow) !important;
    font-weight: 700 !important;
}

.nav-btn span.icon,
.tab-btn span.icon,
.tab-btn .icon {
    font-size: 16px !important;
    flex-shrink: 0;
    order: -1 !important;
}

/* ===== MAIN CONTENT ===== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

section {
    margin-bottom: 32px;
}

/* Section title - left aligned */
h2.section-title,
h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

h2.section-title .icon,
h2 .icon {
    font-size: 22px;
}

h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    text-align: left;
}

h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.75;
}

/* ===== CARD (Glassmorphism) ===== */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 18px;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

.card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ===== HORIZONTAL GRID (Analytics-style) ===== */
.horizontal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.grid-item {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 22px 14px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
}

.grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.15), transparent);
    transition: left 0.6s ease;
}

.grid-item:hover::before {
    left: 100%;
}

.grid-item:hover {
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
}

.grid-item .item-icon {
    font-size: 34px;
    margin-bottom: 12px;
    display: block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.grid-item:hover .item-icon {
    transform: scale(1.15) rotate(-3deg);
}

.grid-item .item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: 0.3px;
}

/* ===== METRIC CARDS (Numbers display) ===== */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    transition: var(--transition);
}

.metric-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.metric-card .metric-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
    font-weight: 600;
}

.metric-card .metric-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
    margin-bottom: 4px;
}

.metric-card .metric-sub {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--gradient-active);
    color: #fff;
    box-shadow: var(--gradient-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
}

.btn-gold {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-gold:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-gold);
}

.btn-red {
    background: var(--color-youtube);
    color: #fff;
}

.btn-red:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

.btn-green {
    background: var(--color-spotify);
    color: #fff;
}

.btn-green:hover {
    background: #1aa34a;
    transform: translateY(-1px);
}

/* "View Details" small button */
.btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    color: #A78BFA;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-detail:hover {
    background: var(--gradient-active);
    color: #fff;
    border-color: transparent;
    transform: translateX(2px);
}

/* ===== PLATFORM BADGES (logos + names) ===== */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
}

.platform-badge.youtube {
    background: rgba(255, 0, 0, 0.15);
    color: #FF6B6B;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.platform-badge.spotify {
    background: rgba(29, 185, 84, 0.15);
    color: #1DB954;
    border: 1px solid rgba(29, 185, 84, 0.3);
}

.platform-badge.apple {
    background: rgba(250, 36, 60, 0.15);
    color: #FA243C;
    border: 1px solid rgba(250, 36, 60, 0.3);
}

.platform-badge.tiktok {
    background: rgba(254, 44, 85, 0.15);
    color: #FE2C55;
    border: 1px solid rgba(254, 44, 85, 0.3);
}

.platform-badge.instagram {
    background: rgba(228, 64, 95, 0.15);
    color: #E4405F;
    border: 1px solid rgba(228, 64, 95, 0.3);
}

.platform-badge.facebook {
    background: rgba(24, 119, 242, 0.15);
    color: #1877F2;
    border: 1px solid rgba(24, 119, 242, 0.3);
}

/* ===== FOOTER ===== */
footer {
    background: var(--bg-deeper);
    border-top: 1px solid var(--border-subtle);
    padding: 24px 16px;
    text-align: center;
    margin-top: 40px;
}

footer p {
    font-size: 11px;
    color: var(--text-dim);
}

/* ===== ANIMATIONS (Sprite's touch) ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(139, 92, 246, 0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.shimmer-accent {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 50%, var(--accent) 100%);
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pulse-dot {
    animation: pulse-glow 2s ease-in-out infinite;
}

.float-icon {
    animation: float 3s ease-in-out infinite;
}

/* ===== PAGE-SPECIFIC ACCENT CLASSES ===== */
/* For content area (not navigation) */
body.page-spotify .section-title,
body.page-spotify h2 {
    color: var(--color-spotify);
    border-bottom-color: rgba(29, 185, 84, 0.3);
}

body.page-spotify .metric-card .metric-value {
    color: var(--color-spotify);
}

body.page-youtube .section-title,
body.page-youtube h2,
body.page-top20 .section-title,
body.page-top20 h2 {
    color: var(--color-youtube);
    border-bottom-color: rgba(255, 0, 0, 0.3);
}

body.page-mystic .section-title,
body.page-mystic h2 {
    color: var(--color-mystic);
    border-bottom-color: rgba(157, 78, 221, 0.3);
}

body.page-calendar .section-title,
body.page-calendar h2 {
    color: var(--color-calendar);
    border-bottom-color: rgba(0, 180, 216, 0.3);
}

body.page-brand .section-title,
body.page-brand h2 {
    color: #4DA3FF;
    border-bottom-color: rgba(0, 102, 204, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    h1.page-title, h1 { font-size: 20px; }
    nav.unified-nav, .tabs-grid, .nav-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 5px !important;
    }
    .nav-btn, .tab-btn {
        padding: 7px 4px !important;
        font-size: 10px !important;
    }
    .horizontal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (min-width: 1024px) {
    h1.page-title, h1 { font-size: 30px; }
    main { padding: 32px 20px 60px; }
    .horizontal-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* ===== UTILITY ===== */
.text-accent { color: var(--accent); }
.text-red { color: var(--color-youtube); }
.text-green { color: var(--color-spotify); }
.text-purple { color: #A78BFA; }
.text-light { color: var(--text-light); }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }
.text-left { text-align: left; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ===== DETAIL SECTIONS (Modals) ===== */
.detail-section { padding: 0; }
.detail-section h4 {
    font-size: 14px; font-weight: 700; color: var(--accent);
    margin-top: 16px; margin-bottom: 8px; letter-spacing: 0.5px;
}
.detail-section h4:first-child { margin-top: 0; }
.detail-section p {
    font-size: 13px; color: var(--text-light);
    line-height: 1.5; margin-bottom: 10px;
}
.detail-list {
    list-style: none; padding: 0; margin: 0 0 10px 0;
    display: flex; flex-direction: column; gap: 6px;
}
.detail-list li {
    font-size: 12px; color: var(--text-light);
    padding-left: 0; margin-left: 0;
    line-height: 1.4;
}
.detail-list li strong { color: var(--text); }
.detail-list ol { margin-left: 18px; }
.detail-inline { display: inline; }
.detail-inline li { color: var(--text-light); }
.detail-inline li strong { color: var(--text); }

/* Button styling for detail trigger */
.detail-btn {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #F59E0B !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    display: inline-block !important;
    margin-top: 8px !important;
}
.detail-btn:hover {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
}
