/* PP Neue Machina Font (loaded via Tailwind CSS build) */

/* ============================================
   Design System - Orno Beauty Dashboard
   ============================================ */

:root {
    /* Brand Colors */
    --brand-primary: 251, 146, 60; /* orange-400 */
    --brand-secondary: 251, 191, 36; /* amber-400 */
    --brand-accent: 52, 211, 153; /* emerald-400 */

    /* Background gradients */
    --bg-gradient-start: 254, 252, 232; /* amber-50 */
    --bg-gradient-middle: 255, 247, 237; /* orange-50 */
    --bg-gradient-end: 240, 253, 244; /* green-50 */

    /* Text colors */
    --text-primary: 124, 45, 18; /* orange-900 */
    --text-secondary: 194, 65, 12; /* orange-700 */
    --text-muted: 180, 83, 9; /* orange-800 */

    /* Surfaces */
    --surface-glass: 255, 255, 255; /* white with opacity */
    --surface-card: 254, 252, 232; /* amber-50 */

    /* Status colors */
    --status-success: 34, 197, 94; /* green-500 */
    --status-warning: 251, 191, 36; /* amber-400 */
    --status-error: 239, 68, 68; /* red-500 */
    --status-info: 59, 130, 246; /* blue-500 */

    /* Legacy variables for backward compatibility */
    --bg-app: #fbf8f1;
    --bg-card: #ffffff;
    --text-brand: #8b4513;
    --color-success: #27ae60;
    --bg-success-light: #e8f8f5;
    --color-danger: #eb5757;
    --color-warning: #f2994a;
    --bg-warning-light: #fef5e7;
    --radius-card: 16px;
    --radius-sm: 8px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* ============================================
   Base Styles
   ============================================ */

* {
    border-color: rgba(251, 191, 36, 0.2);
}

body {
    font-family:
        "PP Neue Machina",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Roboto",
        "Oxygen",
        "Ubuntu",
        "Cantarell",
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(to bottom right, #fffbeb, #fff7ed, #f0fdf4);
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: rgb(124, 45, 18); /* orange-900 */
}

/* ============================================
   Glass Morphism Components
   ============================================ */

.glass {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ============================================
   Header Glass Bar
   ============================================ */

.header-glass {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

/* ============================================
   Brand Gradients
   ============================================ */

.gradient-brand {
    background: linear-gradient(to bottom right, #fb923c, #fbbf24);
}

.gradient-success {
    background: linear-gradient(to bottom right, #4ade80, #34d399);
}

.gradient-page {
    background: linear-gradient(to bottom right, #fffbeb, #fff7ed, #f0fdf4);
}

.gradient-orange-amber {
    background: linear-gradient(to bottom right, #f97316, #f59e0b);
}

.gradient-green-emerald {
    background: linear-gradient(to bottom right, #22c55e, #10b981);
}

.gradient-green-teal {
    background: linear-gradient(to bottom right, #22c55e, #14b8a6);
}

.gradient-amber-yellow {
    background: linear-gradient(to bottom right, #f59e0b, #eab308);
}

/* ============================================
   Metric Cards
   ============================================ */

.metric-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.2;
    z-index: 0;
}

.metric-card.gradient-green::before {
    background: linear-gradient(to bottom right, #4ade80, #34d399);
}

.metric-card.gradient-orange::before {
    background: linear-gradient(to bottom right, #f97316, #f59e0b);
}

.metric-card.gradient-amber::before {
    background: linear-gradient(to bottom right, #f59e0b, #f97316);
}

.metric-card.gradient-teal::before {
    background: linear-gradient(to bottom right, #22c55e, #14b8a6);
}

.metric-card-content {
    position: relative;
    z-index: 10;
}

.metric-icon {
    padding: 0.75rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.metric-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: rgb(124, 45, 18);
    letter-spacing: -0.025em;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(194, 65, 12, 0.7);
    margin-bottom: 0.25rem;
}

.metric-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.metric-change.positive {
    color: #16a34a;
}

.metric-change.negative {
    color: #dc2626;
}

.metric-change-label {
    color: rgba(194, 65, 12, 0.6);
}

/* ============================================
   Summary Stats Cards
   ============================================ */

.stat-card {
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid;
    text-align: center;
}

.stat-card.green {
    background: linear-gradient(
        to bottom right,
        rgba(187, 247, 208, 0.6),
        rgba(167, 243, 208, 0.6)
    );
    border-color: rgba(74, 222, 128, 0.4);
}

.stat-card.orange {
    background: linear-gradient(
        to bottom right,
        rgba(254, 215, 170, 0.6),
        rgba(254, 243, 199, 0.6)
    );
    border-color: rgba(251, 146, 60, 0.4);
}

.stat-card.amber {
    background: linear-gradient(
        to bottom right,
        rgba(254, 243, 199, 0.5),
        rgba(254, 249, 195, 0.5)
    );
    border-color: rgba(251, 191, 36, 0.3);
}

.stat-card.teal {
    background: linear-gradient(
        to bottom right,
        rgba(187, 247, 208, 0.5),
        rgba(153, 246, 228, 0.5)
    );
    border-color: rgba(74, 222, 128, 0.3);
}

.stat-icon {
    width: 1rem;
    height: 1rem;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ============================================
   Video/Product Lists
   ============================================ */

.list-item-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
    transition: background 0.2s ease;
}

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

.list-item-card:hover {
    background: rgba(255, 247, 237, 0.5);
    border-radius: 0.5rem;
    margin: 0 -0.5rem;
    padding: 1rem 0.5rem;
}

.rank-badge {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: linear-gradient(
        to bottom right,
        rgba(251, 146, 60, 0.3),
        rgba(251, 191, 36, 0.3)
    );
    border: 1px solid rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: rgb(194, 65, 12);
}

.rank-badge.top-performer {
    background: linear-gradient(
        to bottom right,
        rgba(74, 222, 128, 0.3),
        rgba(52, 211, 153, 0.3)
    );
    border: 2px solid rgba(74, 222, 128, 0.4);
    color: rgb(22, 101, 52);
}

/* ============================================
   Progress Bars
   ============================================ */

.progress-bar {
    height: 0.375rem;
    background: rgba(251, 191, 36, 0.2);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(to right, #fb923c, #fbbf24);
    transition: width 0.8s ease-out;
}

.progress-bar-fill.green {
    background: linear-gradient(to right, #22c55e, #10b981);
}

/* ============================================
   Tables
   ============================================ */

.data-table {
    width: 100%;
}

.data-table thead tr {
    border-bottom: 2px solid rgba(74, 222, 128, 0.3);
}

.data-table th {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(22, 101, 52);
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(74, 222, 128, 0.2);
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(240, 253, 244, 0.5);
}

.data-table tbody tr.top-performer {
    background: rgba(187, 247, 208, 0.4);
}

.data-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
}

.data-table tfoot tr {
    border-top: 2px solid rgba(74, 222, 128, 0.4);
    background: rgba(187, 247, 208, 0.3);
}

.data-table tfoot td {
    font-weight: 700;
    color: rgb(22, 101, 52);
}

/* ============================================
   Affiliate Badge
   ============================================ */

.affiliate-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
}

.affiliate-avatar.default {
    background: linear-gradient(
        to bottom right,
        rgba(251, 146, 60, 0.3),
        rgba(251, 191, 36, 0.3)
    );
    color: rgb(124, 45, 18);
}

.affiliate-avatar.top {
    background: linear-gradient(
        to bottom right,
        rgba(74, 222, 128, 0.3),
        rgba(52, 211, 153, 0.3)
    );
    border: 2px solid rgba(74, 222, 128, 0.4);
    color: rgb(22, 101, 52);
}

.top-badge {
    font-size: 0.75rem;
    background: rgba(74, 222, 128, 0.2);
    color: rgb(21, 128, 61);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-left: 0.5rem;
}

/* ============================================
   Live Performance Cards
   ============================================ */

.live-card {
    background: linear-gradient(
        to bottom right,
        rgba(255, 247, 237, 0.7),
        rgba(254, 243, 199, 0.7)
    );
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(251, 191, 36, 0.4);
    transition: background 0.2s ease;
}

.live-card:hover {
    background: rgba(254, 215, 170, 0.6);
}

.live-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #f97316;
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ============================================
   Revenue Chart Placeholder
   ============================================ */

.chart-container {
    height: 16rem;
    background: linear-gradient(
        to bottom,
        rgba(255, 247, 237, 0.5),
        rgba(240, 253, 244, 0.5)
    );
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(251, 191, 36, 0.3);
}

/* ============================================
   Animations
   ============================================ */

@keyframes fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 10px rgba(251, 146, 60, 0.4);
    }
    100% {
        box-shadow: 0 0 20px rgba(251, 146, 60, 0.6);
    }
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

.animate-fade-in-delay-1 {
    opacity: 0;
    animation: fade-in 0.5s ease-out 0.1s forwards;
}

.animate-fade-in-delay-2 {
    opacity: 0;
    animation: fade-in 0.5s ease-out 0.2s forwards;
}

.animate-fade-in-delay-3 {
    opacity: 0;
    animation: fade-in 0.5s ease-out 0.3s forwards;
}

.animate-fade-in-delay-4 {
    opacity: 0;
    animation: fade-in 0.5s ease-out 0.4s forwards;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

/* ============================================
   Custom Scrollbar
   ============================================ */

.scrollbar-thin::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: rgba(251, 191, 36, 0.1);
    border-radius: 9999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(251, 146, 60, 0.5);
    border-radius: 9999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(251, 146, 60, 0.7);
}

/* ============================================
   HTMX Progress Indicator
   ============================================ */

.progress {
    position: fixed;
    top: 0;
    z-index: 1000;
    height: 4px;
    width: 100%;
    border-radius: 2px;
    background-clip: padding-box;
    overflow: hidden;
    background: linear-gradient(to right, #fb923c, #fbbf24);
}

.progress .indeterminate:before {
    content: "";
    position: absolute;
    background-color: inherit;
    top: 0;
    left: 0;
    bottom: 0;
    will-change: left, right;
    animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395)
        infinite;
}

.progress .indeterminate:after {
    content: "";
    position: absolute;
    background-color: inherit;
    top: 0;
    left: 0;
    bottom: 0;
    will-change: left, right;
    animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1)
        infinite;
    animation-delay: 1.15s;
}

.progress {
    display: none;
}

.htmx-request .progress {
    display: inline;
}

.htmx-request.progress {
    display: inline;
}

@keyframes indeterminate {
    0% {
        left: -35%;
        right: 100%;
    }
    60% {
        left: 100%;
        right: -90%;
    }
    100% {
        left: 100%;
        right: -90%;
    }
}

@keyframes indeterminate-short {
    0% {
        left: -200%;
        right: 100%;
    }
    60% {
        left: 107%;
        right: -8%;
    }
    100% {
        left: 107%;
        right: -8%;
    }
}

/* ============================================
   Button Styles
   ============================================ */

.btn-brand {
    background: linear-gradient(to right, #fb923c, #f59e0b);
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.3);
}

.btn-brand:hover {
    background: linear-gradient(to right, #f97316, #f59e0b);
    box-shadow: 0 6px 16px rgba(251, 146, 60, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: rgba(255, 237, 213, 0.5);
    border: 1px solid rgba(251, 191, 36, 0.5);
    color: rgb(154, 52, 18);
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: rgba(254, 215, 170, 0.7);
    color: rgb(124, 45, 18);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: rgba(255, 247, 237, 0.5);
    border-radius: 0.75rem;
}

.empty-state p {
    color: rgba(194, 65, 12, 0.6);
    font-size: 0.875rem;
}

/* ============================================
   Section Headers
   ============================================ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: rgb(124, 45, 18);
}

.section-subtitle {
    font-size: 0.875rem;
    color: rgba(194, 65, 12, 0.6);
}

.section-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.section-badge.orange {
    background: linear-gradient(
        to right,
        rgba(249, 115, 22, 0.2),
        rgba(245, 158, 11, 0.2)
    );
    color: rgb(154, 52, 18);
}

.section-badge.green {
    background: linear-gradient(
        to right,
        rgba(34, 197, 94, 0.2),
        rgba(16, 185, 129, 0.2)
    );
    color: rgb(22, 101, 52);
}

/* ============================================
   Utility Text Colors
   ============================================ */

.text-orange-900 {
    color: rgb(124, 45, 18);
}
.text-orange-800 {
    color: rgb(154, 52, 18);
}
.text-orange-700 {
    color: rgb(194, 65, 12);
}
.text-orange-600 {
    color: rgb(234, 88, 12);
}
.text-green-900 {
    color: rgb(20, 83, 45);
}
.text-green-800 {
    color: rgb(22, 101, 52);
}
.text-green-700 {
    color: rgb(21, 128, 61);
}
.text-green-600 {
    color: rgb(22, 163, 74);
}
.text-amber-900 {
    color: rgb(120, 53, 15);
}
.text-amber-800 {
    color: rgb(146, 64, 14);
}
.text-amber-700 {
    color: rgb(180, 83, 9);
}

/* ============================================
   Icon Colors
   ============================================ */

.icon-orange {
    color: #f97316;
}
.icon-amber {
    color: #f59e0b;
}
.icon-green {
    color: #22c55e;
}
.icon-emerald {
    color: #10b981;
}
.icon-teal {
    color: #14b8a6;
}

/* ============================================
   Mascot hover crossfade
   ============================================ */
.mascot-hover {
    position: relative;
    cursor: pointer;
}
.mascot-hover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 500ms ease-in-out;
}
.mascot-hover img:first-child  { opacity: 1; }
.mascot-hover img:last-child   { opacity: 0; }
.mascot-hover:hover img:first-child { opacity: 0; }
.mascot-hover:hover img:last-child  { opacity: 1; }
