/* PRIMEUS Dashboard - Styles principaux */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
    --dark-bg: #34495e;
    --text-color: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--secondary-color), var(--success-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.logo-text h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
}

.logo-text p {
    color: #7f8c8d;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

/* Dashboard Grid */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-bg);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.card-icon.revenue {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

.card-icon.sellers {
    background: linear-gradient(45deg, #3498db, #2980b9);
}

/* Revenue Chart */
.revenue-chart {
    position: relative;
    height: 400px;
}

.revenue-bar-container {
    position: relative;
    height: 350px;
    width: 120px;
    margin: 0 auto;
    background: linear-gradient(to top, #ecf0f1, #bdc3c7);
    border-radius: 10px;
    overflow: visible;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.revenue-bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, #27ae60, #2ecc71);
    border-radius: 0 0 10px 10px;
    transition: height 1s ease-in-out;
}

.threshold-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.threshold-marker {
    position: absolute;
    left: 100%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    margin-left: 10px;
}

.threshold-star {
    font-size: 20px;
    color: #ffd700;
    opacity: 0.5;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    position: relative;
    z-index: 11;
    flex-shrink: 0;
}

.threshold-star.reached {
    opacity: 1;
    transform: scale(1.1);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
    animation: starGlow 2s ease-in-out infinite alternate;
}

@keyframes starGlow {
    0% { text-shadow: 0 0 15px rgba(255, 215, 0, 0.9); }
    100% { text-shadow: 0 0 25px rgba(255, 215, 0, 1), 0 0 35px rgba(255, 215, 0, 0.7); }
}

.threshold-label {
    background: white;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    border: 1px solid #e8f4fd;
    min-width: 60px;
}

.threshold-bonus {
    color: #27ae60;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.threshold-progress {
    color: #7f8c8d;
    font-size: 10px;
    font-weight: 500;
    text-transform: lowercase;
    line-height: 1.1;
}

.revenue-amount {
    text-align: center;
    margin-top: 20px;
}

.revenue-amount .amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--success-color);
    display: block;
}

.revenue-amount .label {
    font-size: 14px;
    color: #000000;
    margin-top: 5px;
}

/* Sellers Chart - Style Podium avec Projecteurs */
.sellers-chart {
    height: 450px;
    overflow-y: auto;
    background: 
     radial-gradient(ellipse 800px 400px at center top, rgba(139, 69, 19, 0.3) 0%, transparent 70%),
 linear-gradient(180deg, #ffea81 0%, #5a4432 20%, #a77037 40%, #a96c3a 60%, #5f2b16 100%);
    border-radius: 15px;
    padding: 30px 20px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 0 50px rgba(0,0,0,0.5),
        0 10px 30px rgba(0,0,0,0.3);
}

/* Projecteurs de scène */
.sellers-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        /* Projecteur gauche */
        radial-gradient(ellipse 150px 300px at 15% 0%, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 30%, transparent 60%),
        /* Projecteur droit */
        radial-gradient(ellipse 150px 300px at 85% 0%, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 30%, transparent 60%),
        /* Projecteur central */
        radial-gradient(ellipse 120px 250px at 50% 0%, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.05) 40%, transparent 70%),
        /* Éclairage ambiant */
        linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 20%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Tapis rouge du podium */
.sellers-chart::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 25px;
    background: 
        linear-gradient(90deg, 
            transparent 0%, 
            rgba(139,0,0,0.6) 10%, 
            rgba(178,34,34,0.9) 25%, 
            rgba(220,20,60,1) 50%, 
            rgba(178,34,34,0.9) 75%, 
            rgba(139,0,0,0.6) 90%, 
            transparent 100%),
        linear-gradient(180deg, rgba(220,20,60,1) 0%, rgba(139,0,0,0.8) 100%);
    border-radius: 15px 15px 0 0;
    box-shadow: 
        0 -8px 25px rgba(220,20,60,0.6),
        inset 0 2px 10px rgba(255,255,255,0.2);
    z-index: 1;
}

/* Effet de brouillard/fumée */
.sellers-chart .stage-fog {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: 
        radial-gradient(ellipse 200px 30px at 20% 100%, rgba(255,255,255,0.1) 0%, transparent 70%),
        radial-gradient(ellipse 200px 30px at 80% 100%, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* Confettis Animation */
.sellers-chart .confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: confetti-fall linear infinite;
    opacity: 0.8;
}

.confetti:nth-child(1) {
    background: #ff6b6b;
    left: 10%;
    animation-duration: 3s;
    animation-delay: 0s;
}

.confetti:nth-child(2) {
    background: #4ecdc4;
    left: 20%;
    animation-duration: 2.5s;
    animation-delay: 0.5s;
}

.confetti:nth-child(3) {
    background: #45b7d1;
    left: 30%;
    animation-duration: 3.2s;
    animation-delay: 1s;
}

.confetti:nth-child(4) {
    background: #f9ca24;
    left: 40%;
    animation-duration: 2.8s;
    animation-delay: 1.5s;
}

.confetti:nth-child(5) {
    background: #f0932b;
    left: 50%;
    animation-duration: 3.5s;
    animation-delay: 0.3s;
}

.confetti:nth-child(6) {
    background: #eb4d4b;
    left: 60%;
    animation-duration: 2.7s;
    animation-delay: 0.8s;
}

.confetti:nth-child(7) {
    background: #6c5ce7;
    left: 70%;
    animation-duration: 3.1s;
    animation-delay: 1.2s;
}

.confetti:nth-child(8) {
    background: #a29bfe;
    left: 80%;
    animation-duration: 2.9s;
    animation-delay: 0.7s;
}

.confetti:nth-child(9) {
    background: #fd79a8;
    left: 90%;
    animation-duration: 3.3s;
    animation-delay: 1.8s;
}

.confetti:nth-child(10) {
    background: #00b894;
    left: 15%;
    animation-duration: 2.6s;
    animation-delay: 2s;
}

.confetti:nth-child(11) {
    background: #fdcb6e;
    left: 25%;
    animation-duration: 3.4s;
    animation-delay: 0.2s;
}

.confetti:nth-child(12) {
    background: #e17055;
    left: 35%;
    animation-duration: 2.4s;
    animation-delay: 1.3s;
}

.confetti:nth-child(13) {
    background: #74b9ff;
    left: 45%;
    animation-duration: 3.6s;
    animation-delay: 0.9s;
}

.confetti:nth-child(14) {
    background: #55a3ff;
    left: 55%;
    animation-duration: 2.3s;
    animation-delay: 1.7s;
}

.confetti:nth-child(15) {
    background: #ff7675;
    left: 65%;
    animation-duration: 3.7s;
    animation-delay: 0.4s;
}

@keyframes confetti-fall {
    0% {
        top: -10px;
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    25% {
        transform: rotate(90deg) scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
        opacity: 0.6;
    }
    75% {
        transform: rotate(270deg) scale(0.9);
        opacity: 0.4;
    }
    100% {
        top: 100%;
        transform: rotate(360deg) scale(0.7);
        opacity: 0;
    }
}

.seller-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.seller-item:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: translateX(5px);
}

.seller-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}

.seller-info {
    flex: 1;
}

.seller-name {
    font-weight: 600;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
}

.seller-stats {
    font-size: 14px;
    color: rgb(255 255 255 / 54%);
    margin-top: 2px;
}

.seller-bar-container {
    flex: 2;
    height: 30px;
    background: #ecf0f1;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.seller-bar {
    height: 100%;
    border-radius: 15px;
    transition: width 1s ease-in-out;
    position: relative;
}

.seller-bonus {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
    padding: 0 10px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    backdrop-filter: blur(15px);
    padding: 30px 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(0);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color, #3498db), var(--accent-secondary, #2980b9));
    border-radius: 20px 20px 0 0;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card:nth-child(1) { 
    --accent-color: #e74c3c; 
    --accent-secondary: #c0392b; 
}
.stat-card:nth-child(2) { 
    --accent-color: #f39c12; 
    --accent-secondary: #e67e22; 
}
.stat-card:nth-child(3) { 
    --accent-color: #27ae60; 
    --accent-secondary: #229954; 
}
.stat-card:nth-child(4) { 
    --accent-color: #3498db; 
    --accent-secondary: #2980b9; 
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-color, #3498db), var(--accent-secondary, #2980b9));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 8px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 0.95rem;
    color: #5a6c7d;
    margin-top: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-color, #3498db), var(--accent-secondary, #2980b9));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: white;
}

/* Styles pour les trophées et classement */
.seller-ranking {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    min-width: 40px;
}

.trophy-icon {
    width: 35px;
    height: 35px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: trophyGlow 2s ease-in-out infinite alternate;
}

.trophy-icon:hover {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.ranking-number {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.seller-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.seller-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(5px) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.seller-item:nth-child(1) {
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,193,7,0.1));
    border: 1px solid rgba(255,215,0,0.3);
    box-shadow: 0 4px 20px rgba(255,215,0,0.3);
}

.seller-item:nth-child(2) {
    background: linear-gradient(135deg, rgba(192,192,192,0.2), rgba(169,169,169,0.1));
    border: 1px solid rgba(192,192,192,0.3);
    box-shadow: 0 4px 20px rgba(192,192,192,0.2);
}

.seller-item:nth-child(3) {
    background: linear-gradient(135deg, rgba(205,127,50,0.2), rgba(184,115,51,0.1));
    border: 1px solid rgba(205,127,50,0.3);
    box-shadow: 0 4px 20px rgba(205,127,50,0.2);
}

@keyframes trophyGlow {
    0% { 
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)) brightness(1);
    }
    100% { 
        filter: drop-shadow(0 4px 8px rgba(255,215,0,0.4)) brightness(1.1);
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px #f39c12; }
    100% { box-shadow: 0 0 20px #f39c12, 0 0 30px #f39c12; }
}

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

.card {
    animation: slideInUp 0.6s ease-out;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 18px;
    color: #7f8c8d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .stats-summary {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .seller-item {
        flex-direction: column;
        text-align: center;
    }
    
    .seller-bar-container {
        width: 100%;
    }
}

/* Admin styles */
.admin-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.admin-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.admin-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--secondary-color);
    color: white;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.table tr:hover {
    background: rgba(52, 152, 219, 0.1);
}
