/**
 * Xerionyx Treasury Styles - Styles CSS Dédiés
 * Feuille de style pour le module Treasury
 * Design cohérent avec le thème Xerionyx
 */

/* ========================================
   INTERFACE TRÉSORERIE UI
   ======================================== */

.treasury-ui {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(34, 211, 238, 0.1);
    transition: all 0.3s ease;
}

.treasury-ui.updating {
    border-color: rgba(34, 211, 238, 0.3);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.1);
}

.treasury-total,
.treasury-presale,
.treasury-onchain,
.treasury-contributions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.treasury-total:hover,
.treasury-presale:hover,
.treasury-onchain:hover,
.treasury-contributions:hover {
    background: rgba(34, 211, 238, 0.05);
    border-color: rgba(34, 211, 238, 0.2);
    transform: translateY(-2px);
}

.treasury-progress {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.ui-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.ui-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22d3ee;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
    transition: all 0.2s ease;
}

/* Hiérarchie visuelle */
.treasury-total .ui-value {
    font-size: 1.8rem;
    color: #22d3ee;
    text-shadow: 0 0 15px rgba(34, 211, 238, 0.4);
}

.treasury-presale .ui-value,
.treasury-onchain .ui-value {
    font-size: 1.3rem;
    color: #6366f1;
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.treasury-contributions .ui-value,
.treasury-progress .progress-text {
    font-size: 1.1rem;
    color: #94a3b8;
    text-shadow: 0 0 5px rgba(148, 163, 184, 0.2);
}

/* Animation de changement de valeur */
.ui-value.updating {
    transform: scale(1.05);
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #6366f1);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #22d3ee;
    min-width: 40px;
    text-align: right;
}

/* ========================================
   TIRELIRE 3D - PIGGY BANK FUTURISTE
   ======================================== */

.treasury-piggybank-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 400px;
    margin: 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#treasury-piggybank {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.4);
    border: 2px solid rgba(34, 211, 238, 0.2);
    box-shadow: 
        0 0 40px rgba(34, 211, 238, 0.1),
        0 0 80px rgba(34, 211, 238, 0.05),
        inset 0 0 20px rgba(34, 211, 238, 0.05);
}

/* ========================================
   FEEDBACK PSYCHOLOGIQUE
   ======================================== */

.treasury-psychological-feedback {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.ui-psychological-message {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 6px;
    padding: 8px 16px;
    color: #22d3ee;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.2);
    pointer-events: none;
}

.ui-psychological-message.positive {
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.ui-psychological-message.growth {
    border-color: rgba(34, 211, 238, 0.3);
    color: #22d3ee;
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.2);
}

.ui-psychological-message.milestone {
    border-color: rgba(168, 85, 247, 0.3);
    color: #a855f7;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.ui-psychological-message.stable {
    border-color: rgba(148, 163, 184, 0.3);
    color: #94a3b8;
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.2);
}

/* ========================================
   CONTENEURS PRINCIPAUX
   ======================================== */

.treasury-visual-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.treasury-graph-container {
    width: 100%;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* ========================================
   EN-TÊTES ET TITRES
   ======================================== */

.treasury-header {
    text-align: center;
    margin-bottom: 30px;
}

.treasury-title {
    font-size: 2rem;
    font-weight: 600;
    color: #22d3ee;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.treasury-balance-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 700;
    color: #22d3ee;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
    transition: all 0.3s ease;
}

.balance-label {
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.graph-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #22d3ee;
    margin: 0;
}

.graph-controls {
    display: flex;
    gap: 8px;
}

.graph-btn {
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.graph-btn:hover {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.4);
    color: #22d3ee;
}

.graph-btn.active {
    background: rgba(34, 211, 238, 0.2);
    border-color: #22d3ee;
    color: #22d3ee;
}

/* ========================================
   CONTENEURS CANVAS
   ======================================== */

.treasury-canvas-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 30px;
    background: rgba(15, 23, 42, 0.4);
    border: 2px solid rgba(34, 211, 238, 0.2);
    border-radius: 50%;
    padding: 20px;
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.2);
}

#treasury-canvas {
    width: 100%;
    height: auto;
    border-radius: 50%;
}

.graph-canvas-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

#treasury-graph {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ========================================
   OVERLAYS ET STATISTIQUES
   ======================================== */

.treasury-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.treasury-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #22d3ee;
}

.stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.graph-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(34, 211, 238, 0.1);
}

.graph-stats .stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 8px;
}

.graph-stats .stat-label {
    font-size: 0.7rem;
    margin-bottom: 5px;
}

.graph-stats .stat-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ========================================
   TENDANCES
   ======================================== */

.trend-up {
    color: #10b981 !important;
}

.trend-down {
    color: #ef4444 !important;
}

.trend-stable {
    color: #22d3ee !important;
}

.trend-icon {
    font-weight: bold;
    margin-right: 5px;
}

/* ========================================
   INFORMATIONS
   ======================================== */

.treasury-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(34, 211, 238, 0.05);
    border-color: rgba(34, 211, 238, 0.2);
    transform: translateY(-2px);
}

.info-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 211, 238, 0.1);
    border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.info-text {
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.4;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.treasury-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.treasury-notification {
    margin-bottom: 10px;
    padding: 15px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.treasury-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.treasury-notification.hide {
    opacity: 0;
    transform: translateX(100%);
}

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

.notification-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
}

.notification-icon.deposit {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.notification-icon.withdrawal {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.notification-icon.governance {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.notification-details {
    flex: 1;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.notification-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #22d3ee;
    margin-bottom: 4px;
}

.notification-hash {
    font-size: 0.8rem;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
}

/* ========================================
   TOOLTIP
   ======================================== */

.graph-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 6px;
    padding: 10px;
    backdrop-filter: blur(10px);
    z-index: 100;
    pointer-events: none;
    transform: translate(-50%, -100%);
}

.tooltip-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #22d3ee;
    margin-bottom: 4px;
}

.tooltip-time {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ========================================
   TABLEAU DES TRANSACTIONS
   ======================================== */

.transactions-list {
    position: relative;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.transactions-table th,
.transactions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(34, 211, 238, 0.1);
}

.transactions-table th {
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.transactions-table td {
    color: #e2e8f0;
    font-size: 0.9rem;
}

.transactions-table tr:hover {
    background: rgba(34, 211, 238, 0.05);
}

.tx-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.tx-type.deposit {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.tx-type.withdrawal {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.tx-type.governance {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.tx-amount {
    font-weight: 600;
    color: #22d3ee;
}

.tx-address {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #94a3b8;
}

.tx-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tx-status.confirmed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.tx-status.pending {
    background: rgba(251, 191, 36, 0.2);
    color: #f59e0b;
}

.tx-status.failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ========================================
   FILTRES
   ======================================== */

.transaction-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-btn:hover {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.4);
    color: #22d3ee;
}

.filter-btn.active {
    background: rgba(34, 211, 238, 0.2);
    border-color: #22d3ee;
    color: #22d3ee;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .treasury-ui {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        padding: 16px;
    }
    
    .treasury-total,
    .treasury-presale,
    .treasury-onchain,
    .treasury-contributions {
        padding: 16px;
    }
    
    .treasury-progress {
        padding: 16px;
    }
    
    .ui-value {
        font-size: 1.2rem;
    }
    
    .ui-label {
        font-size: 0.7rem;
    }
    
    .treasury-piggybank-container {
        max-width: 350px;
        height: 350px;
        margin: 30px auto;
    }
    
    .treasury-psychological-feedback {
        max-width: 300px;
        margin: 15px auto;
        padding: 8px;
        min-height: 50px;
    }
    
    .ui-psychological-message {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .treasury-visual-container {
        padding: 15px;
    }
    
    .treasury-title {
        font-size: 1.5rem;
    }
    
    .balance-amount {
        font-size: 2rem;
    }
    
    .treasury-canvas-container {
        max-width: 350px;
    }
    
    .graph-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .graph-controls {
        justify-content: center;
    }
    
    .graph-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .treasury-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .info-item {
        padding: 15px;
    }
    
    .treasury-notifications {
        position: relative;
        top: auto;
        right: auto;
        max-width: 100%;
        margin-bottom: 20px;
    }
    
    .transactions-table {
        font-size: 0.8rem;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 8px;
    }
    
    .transaction-filters {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .treasury-visual-container {
        padding: 10px;
    }
    
    .treasury-canvas-container {
        max-width: 300px;
    }
    
    .graph-stats {
        grid-template-columns: 1fr;
    }
    
    .graph-btn,
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

/* ========================================
   UTILITAIRES
   ======================================== */

.text-cyan {
    color: #22d3ee;
}

.text-purple {
    color: #a855f7;
}

.text-blue {
    color: #6366f1;
}

.text-green {
    color: #10b981;
}

.text-red {
    color: #ef4444;
}

.text-slate {
    color: #94a3b8;
}

.bg-cyan {
    background-color: #22d3ee;
}

.bg-purple {
    background-color: #a855f7;
}

.bg-blue {
    background-color: #6366f1;
}

.border-cyan {
    border-color: #22d3ee;
}

.border-purple {
    border-color: #a855f7;
}

.border-blue {
    border-color: #6366f1;
}
