/* ============================================
   KRYPTON WALLET - STYLE PRINCIPAL
   Design ultra moderne et responsive
   ============================================ */

/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00b4ff;
    --secondary-color: #6b4aff;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --dark-bg: #0a0e27;
    --card-bg: #1a1e3a;
    --text-primary: #ffffff;
    --text-secondary: #8b93b0;
    --border-color: #2a3a5a;
    --success: #00ff88;
    --error: #ff4444;
    --warning: #ffd93d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, var(--dark-bg) 0%, #0f1530 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background-color: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo svg {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 0 10px rgba(0, 180, 255, 0.5));
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.logout-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 180, 255, 0.4);
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
    flex: 1;
}

/* ============================================
   AUTH (LOGIN/REGISTER)
   ============================================ */

.auth-container {
    max-width: 480px;
    margin: 80px auto;
    padding: 20px;
}

.auth-card {
    background: linear-gradient(145deg, var(--card-bg), #1f2442);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo svg {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(0, 180, 255, 0.6));
}

.auth-logo h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 700;
}

/* ============================================
   FORMULAIRES
   ============================================ */

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px rgba(0, 180, 255, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* ============================================
   BOUTONS
   ============================================ */

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 5px 20px rgba(0, 180, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 180, 255, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 180, 255, 0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   DASHBOARD GRID
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: linear-gradient(145deg, var(--card-bg), #1f2442);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 180, 255, 0.2);
    border-color: rgba(0, 180, 255, 0.5);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-amount {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    letter-spacing: -1px;
}

.balance-currency {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* TX Count Badge */
.tx-count {
    font-size: 14px;
    color: var(--primary-color);
    margin-left: 10px;
    font-weight: 600;
    background: rgba(0, 180, 255, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 180, 255, 0.3);
}

/* ============================================
   ADDRESS DISPLAY
   ============================================ */

.address-display {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    margin: 18px 0;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.address-display:hover {
    border-color: var(--primary-color);
    background: rgba(0, 180, 255, 0.05);
}

.qr-code-container {
    text-align: center;
    margin: 25px 0;
}

.qr-code-container img {
    max-width: 220px;
    border-radius: 12px;
    background: white;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.qr-code-container img:hover {
    transform: scale(1.05);
}

.btn-copy {
    width: 100%;
    margin-top: 15px;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
    height: 3px;
}

.tabs::-webkit-scrollbar-track {
    background: var(--card-bg);
}

.tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.tab {
    padding: 18px 32px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab.active {
    color: var(--primary-color);
}

.tab.active::after {
    transform: scaleX(1);
}

.tab:hover {
    color: var(--primary-color);
    background: rgba(0, 180, 255, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

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

/* ============================================
   TRANSACTIONS - AMÉLIORATIONS
   ============================================ */

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.05), rgba(107, 74, 255, 0.05));
    border: 1px solid rgba(0, 180, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.transaction-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #00b4ff, #6b4aff);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.transaction-item:hover {
    background: linear-gradient(135deg, rgba(0, 180, 255, 0.15), rgba(107, 74, 255, 0.15));
    border-color: rgba(0, 180, 255, 0.5);
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(0, 180, 255, 0.3);
}

.transaction-item:hover::before {
    opacity: 1;
}

.transaction-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.transaction-type-badge {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.transaction-type-badge.receive {
    background: linear-gradient(135deg, rgba(0, 255, 128, 0.25), rgba(0, 200, 100, 0.25));
    color: #00ff80;
    border: 2px solid rgba(0, 255, 128, 0.5);
    box-shadow: 0 4px 12px rgba(0, 255, 128, 0.2);
}

.transaction-type-badge.send {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.25), rgba(255, 60, 60, 0.25));
    color: #ff6b6b;
    border: 2px solid rgba(255, 107, 107, 0.5);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

.transaction-details {
    flex: 1;
    min-width: 0;
}

.transaction-address {
    font-size: 15px;
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    word-break: break-all;
}

.transaction-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.tx-pending {
    color: var(--warning);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tx-confirming {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tx-confirmed {
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tx-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.transaction-right {
    text-align: right;
    padding-left: 20px;
}

.transaction-amount {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    font-family: 'Courier New', monospace;
}

.transaction-amount.positive {
    color: var(--success);
    text-shadow: 0 0 10px rgba(0, 255, 128, 0.5);
}

.transaction-amount.negative {
    color: var(--error);
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.tx-id-short {
    font-size: 11px;
    color: rgba(0, 180, 255, 0.8);
    font-family: 'Courier New', monospace;
    background: rgba(0, 180, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

/* Legacy transaction styles (pour compatibilité) */
.transaction-info {
    flex: 1;
}

.transaction-type {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.transaction-type.receive {
    color: var(--success);
}

.transaction-type.send {
    color: var(--error);
}

/* ============================================
   MESSAGES
   ============================================ */

.message {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.success {
    background: rgba(0, 255, 136, 0.15);
    border: 2px solid var(--success);
    color: var(--success);
}

.message.error {
    background: rgba(255, 68, 68, 0.15);
    border: 2px solid var(--error);
    color: var(--error);
}

.message.info {
    background: rgba(0, 180, 255, 0.15);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   LOADING
   ============================================ */

.loading {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
}

.spinner {
    border: 4px solid rgba(0, 180, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    .header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 16px;
    }

    .logo {
        font-size: 20px;
    }

    .logo svg {
        width: 35px;
        height: 35px;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    .auth-container {
        margin: 40px auto;
        padding: 16px;
    }

    .auth-card {
        padding: 36px 24px;
    }

    .auth-logo svg {
        width: 60px;
        height: 60px;
    }

    .auth-logo h1 {
        font-size: 26px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 24px 20px;
    }

    .balance-amount {
        font-size: 32px;
    }

    .tabs {
        gap: 0;
    }

    .tab {
        padding: 14px 20px;
        font-size: 13px;
    }

    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
    }

    .transaction-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .transaction-type-badge {
        min-width: auto;
        width: fit-content;
    }

    .transaction-right {
        width: 100%;
        text-align: left;
        padding-left: 0;
    }

    .transaction-amount {
        font-size: 18px;
    }

    .qr-code-container img {
        max-width: 180px;
    }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 32px 24px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .transaction-item {
        flex-wrap: wrap;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
