/* BABKI Coin Bot - Styles */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Colors */
    --primary: #0088cc;
    --primary-dark: #006699;
    --primary-light: #33a3dd;
    --success: #2ECC71;
    --warning: #F39C12;
    --error: #E74C3C;
    --info: #3498DB;
    
    /* Backgrounds */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F7FA;
    --bg-tertiary: #E8ECEF;
    
    /* Text */
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-disabled: #BDC3C7;
    --text-white: #FFFFFF;
    
    /* Borders */
    --border-light: #E0E0E0;
    --border-medium: #BDBDBD;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    
    /* Font */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-secondary);
    overflow-x: hidden;
}

code {
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}

/* ========================================
   LOADING SCREEN
   ======================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-screen.hidden {
    display: none;
}

/* ========================================
   TOP PANEL
   ======================================== */
.top-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #0088cc 0%, #005580 100%);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: var(--text-white);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

.user-username {
    font-size: 14px;
    font-weight: 500;
}

.user-balance {
    font-size: 18px;
    font-weight: 700;
    flex: 1;
    text-align: center;
}

.wallet-button {
    height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--text-white);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.wallet-button:hover {
    background: rgba(255,255,255,0.3);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    margin-top: 60px;
    margin-bottom: 60px;
    padding: 16px;
    min-height: calc(100vh - 120px);
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.card-header {
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

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

.placeholder-icon {
    font-size: 64px;
    margin: 20px 0;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: var(--font-family);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--border-medium);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-small {
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    width: auto;
}

/* ========================================
   INPUT FIELDS
   ======================================== */
.input-group {
    margin-bottom: 16px;
}

.input-field {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 16px;
    font-family: var(--font-family);
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

.input-field::placeholder {
    color: var(--text-disabled);
}

/* ========================================
   INFO BOXES
   ======================================== */
.info-box {
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
}

.info-box.warning {
    background: rgba(243, 156, 18, 0.1);
    border-left: 3px solid var(--warning);
}

.info-text {
    margin: 8px 0;
    line-height: 1.6;
}

.info-text.small {
    font-size: 14px;
}

.info-text.muted {
    color: var(--text-secondary);
}

/* ========================================
   ADDRESS BOX
   ======================================== */
.address-box {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
}

.wallet-address {
    flex: 1;
    word-break: break-all;
    font-size: 13px;
}

.telegram-id {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

/* ========================================
   TRANSACTIONS LIST
   ======================================== */
.transactions-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s ease;
}

.transaction-item:hover {
    background: var(--bg-secondary);
}

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

.transaction-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.transaction-icon.deposit {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success);
}

.transaction-icon.withdraw {
    background: rgba(52, 152, 219, 0.1);
    color: var(--info);
}

.transaction-details {
    flex: 1;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.transaction-amount.positive {
    color: var(--success);
}

.transaction-amount.negative {
    color: var(--info);
}

.transaction-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.transaction-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.transaction-status.completed {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success);
}

.transaction-status.pending {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning);
}

.transaction-status.failed {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error);
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--text-white);
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   SPINNERS
   ======================================== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

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

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .top-panel {
        padding: 0 12px;
    }
    
    .user-balance {
        font-size: 16px;
    }
    
    .card {
        padding: 16px;
        border-radius: 8px;
    }
    
    .btn {
        height: 44px;
        font-size: 15px;
    }
}