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

:root {
    --accent:       #ff1975;
    --accent-dark:  #c0004d;
    --accent-light: #ff7eb8;
    --win-bg:       #d4d0c8;
    --win-border-light: #ffffff;
    --win-border-dark:  #404040;
    --win-border-mid:   #808080;
    --title-bar:    #000080;
    --text:         #1a1a1a;
}

body {
    background: var(--win-bg);
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(0,0,0,0.015) 4px,
            rgba(0,0,0,0.015) 8px
        );
    font-family: Tahoma, Arial, sans-serif;
    font-size: 12px;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   BARRE DE TITRE (style Windows 98)
   ============================================================ */
.title-bar {
    background: linear-gradient(to right, #ff007b, #ff3b9a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 13px;
    user-select: none;
}

.title-bar-buttons {
    display: flex;
    gap: 3px;
}

.title-bar-buttons span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 16px;
    background: var(--win-bg);
    color: black;
    font-size: 11px;
    cursor: pointer;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
}

.title-bar-buttons span:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
}

/* ============================================================
   BANDEAU DÉFILANT
   ============================================================ */
.ticker-wrap {
    background: #dc016b;
    color: #ffff00;
    overflow: hidden;
    white-space: nowrap;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 2px solid #ffff00;
}

.ticker {
    display: inline-block;
    animation: ticker-scroll 25s linear infinite;
    padding-left: 100%;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.app-layout {
    display: flex;
    flex: 1;
    gap: 10px;
    padding: 10px;
    overflow: hidden;
}

/* ============================================================
   WIDGETS (sidebars)
   ============================================================ */
.sidebar-left,
.sidebar-right {
    width: 200px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.widget {
    background: var(--win-bg);
    border-top: 2px solid var(--win-border-light);
    border-left: 2px solid var(--win-border-light);
    border-right: 2px solid var(--win-border-dark);
    border-bottom: 2px solid var(--win-border-dark);
}

.widget-title {
    background: linear-gradient(to right, #ff007b, #ff64af);
    color: white;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: bold;
}

.widget-body {
    padding: 8px;
}

/* Horloge */
.clock-display {
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    color: #ff007b;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

.date-display {
    text-align: center;
    font-size: 10px;
    color: #555;
    margin-top: 3px;
}

/* Palette */
.colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.color {
    width: 30px;
    height: 30px;
    cursor: pointer;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    transition: transform 0.1s;
}

.color:hover  { transform: scale(1.1); }
.color:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
}
.black   { background: #000; }
.pink   { background: #ff7eb8; }
.orange   { background: #ff9d00; }
.green  { background: #70d870; }
.purple { background: #c18fff; }
.yellow { background: #ffe066; }
.red    { background: #ff5555; }

/* Stats */
.stats p { margin-bottom: 4px; font-size: 11px; }
.stats strong { color: #ff007b; }

/* Message du jour */
.daily-message {
    font-style: italic;
    font-size: 11px;
    color: #800080;
    text-align: center;
    line-height: 1.4;
}

/* Boutons action */
.btn-action {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    padding: 5px 8px;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 11px;
    cursor: pointer;
    background: var(--win-bg);
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
}

.btn-action:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
}

.btn-action:hover { background: #e0e0e0; }

/* Liste de tenue */
.outfit-list {
    list-style: none;
    font-size: 11px;
    line-height: 1.8;
}

.outfit-list li::before { content: "▸ "; color: #ff007b; }

/* Conseils mode */
.fashion-tip {
    font-size: 11px;
    color: #555;
    line-height: 1.5;
    font-style: italic;
}

/* Compteur visiteurs */
.visitor-bar {
    width: 100%;
    height: 8px;
    background: #808080;
    margin-top: 6px;
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid white;
    border-bottom: 1px solid white;
}

.visitor-fill {
    height: 100%;
    background: linear-gradient(to right, #00aa00, #00ff00);
    width: 60%;
    animation: pulse-bar 2s ease-in-out infinite alternate;
}

@keyframes pulse-bar {
    from { width: 40%; }
    to   { width: 80%; }
}

/* Favoris */
#favorites-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ============================================================
   CENTRE (garde-robe + personnage)
   ============================================================ */
.center-layout {
    flex: 1;
    display: flex;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

/* ============================================================
   GARDE-ROBE
   ============================================================ */
.wardrobe {
    width: 280px;
    min-width: 240px;
    background: var(--win-bg);
    border-top: 3px solid var(--win-border-light);
    border-left: 3px solid var(--win-border-light);
    border-right: 3px solid var(--win-border-dark);
    border-bottom: 3px solid var(--win-border-dark);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wardrobe-title-bar {
    background: linear-gradient(to right, #ff007b, #ff64af);
    color: white;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 13px;
    flex-shrink: 0;
}

/* Onglets */
.tabs {
    display: flex;
    background: var(--win-bg);
    border-bottom: 2px solid var(--win-border-dark);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.tab {
    padding: 4px 10px;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 11px;
    cursor: pointer;
    background: #b0ada4;
    border: none;
    border-right: 1px solid #808080;
    color: #333;
    position: relative;
    top: 2px;
}

.tab.active {
    background: var(--win-bg);
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #808080;
    border-bottom: 2px solid var(--win-bg);
    top: 0;
    color: black;
    font-weight: bold;
    z-index: 1;
}

.tab:hover:not(.active) { background: #c8c5bc; }

/* Panneaux */
.tab-panel {
    display: none;
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.tab-panel.active { display: block; }

.cat-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #ff007b;
    border-bottom: 1px solid #808080;
    padding-bottom: 3px;
}

/* Items */
.items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px;
    cursor: pointer;
    background: #c0c0c0;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    transition: transform 0.1s;
}

.item-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    display: block;
}

.item-card span {
    font-size: 10px;
    text-align: center;
    color: #333;
}

.item-card:hover {
    transform: scale(1.05);
    background: #d4d0c8;
}
.item-card.active,
.item-card:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: scale(0.97);
}

.item-card.selected {
    background: #ff007b;
    border-color: #ffff00;
}

.item-card.selected span { color: white; }

.item-card.empty {
    cursor: default;
    opacity: 0.5;
}

.item-card.empty:hover { transform: none; }

/* ============================================================
   ZONE PERSONNAGE
   ============================================================ */
.character-zone {
    flex: 1;
    background: var(--win-bg);
    border-top: 3px solid var(--win-border-light);
    border-left: 3px solid var(--win-border-light);
    border-right: 3px solid var(--win-border-dark);
    border-bottom: 3px solid var(--win-border-dark);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.character-zone-title {
    background: linear-gradient(to right, #ff007b, #ff64af);
    color: white;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 13px;
    width: 100%;
    text-align: center;
}

.character-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Fond décoratif du personnage */
.character-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    pointer-events: none;
}

#character {
    position: relative;
    width: min(45vh, 280px);
    height: min(70vh, 440px);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

.layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Boutons du bas */
.character-actions {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-top: 2px solid var(--win-border-dark);
    width: 100%;
    justify-content: center;
    background: #c0c0c0;
}

.btn-copy,
.btn-save {
    padding: 6px 16px;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border-top: 3px solid white;
    border-left: 3px solid white;
    border-right: 3px solid #404040;
    border-bottom: 3px solid #404040;
    min-width: 130px;
}

.btn-copy {
    background: #ff007b;
    color: white;
}

.btn-copy:hover  { background: #ff007b; }
.btn-copy:active {
    border-top: 3px solid #404040;
    border-left: 3px solid #404040;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
}

.btn-save {
    background: var(--win-bg);
    color: black;
}

.btn-save:hover  { background: #e0e0e0; }
.btn-save:active {
    border-top: 3px solid #404040;
    border-left: 3px solid #404040;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #ff007b;
    color: white;
    padding: 8px 20px;
    font-size: 12px;
    border: 2px solid #ffff00;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   BARRE DE STATUT
   ============================================================ */
.status-bar {
    background: var(--win-bg);
    border-top: 2px solid var(--win-border-dark);
    display: flex;
    justify-content: space-between;
    padding: 3px 10px;
    font-size: 11px;
    color: #333;
    flex-shrink: 0;
}

/* ============================================================
   SCANLINES (effet CRT)
   ============================================================ */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        transparent 0px,
        transparent 2px,
        rgba(0,0,0,0.025) 3px
    );
    z-index: 9999;
}

/* ============================================================
   SCROLLBAR CUSTOM
   ============================================================ */
::-webkit-scrollbar       { width: 16px; }
::-webkit-scrollbar-track { background: var(--win-bg); border-left: 1px solid #808080; }

::-webkit-scrollbar-thumb {
    background: var(--win-bg);
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
}

::-webkit-scrollbar-button {
    background: var(--win-bg);
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    height: 16px;
}

/* ============================================================
   THEMES
   ============================================================ */
body.theme-blue   { --accent: #1084d0; --accent-dark: #0050a0; }
/* body.theme-purple { --accent: #800080; --accent-dark: #500050; } */
body.theme-green  { --accent: #008000; --accent-dark: #005000; }
/* body.theme-yellow { --accent: #c8a800; --accent-dark: #806800; }
body.theme-red    { --accent: #cc0000; --accent-dark: #880000; } */
