/* ==========================
   COMMON STYLES - SHARED ACROSS ALL PAGES
   ========================== */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1A1D29;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* ==========================
   WELCOME SCREEN
   ========================== */

.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1A1D29;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.welcome-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.welcome-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 400px;
}

.welcome-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 32px;
}

.welcome-logo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.2;
}

.welcome-subtitle {
    font-size: 16px;
    color: #8E92A8;
    margin-bottom: 48px;
    line-height: 1.5;
}

.welcome-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #FF7F50 0%, #FF6B3D 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(255, 127, 80, 0.3);
}

.welcome-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 127, 80, 0.3);
}

/* Pull to Refresh */
.pull-to-refresh {
    position: absolute;
    top: 60px; /* Under header */
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 100;
}

.pull-to-refresh.visible {
    opacity: 1;
}

.pull-to-refresh-icon {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 127, 80, 0.3);
    border-top-color: #FF7F50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.pull-to-refresh-icon.pulling {
    animation: none;
    transform: rotate(0deg);
    transition: transform 0.2s;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Container */
.container {
    max-width: 500px;
    margin: 0 auto;
    background: #1A1D29;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 90px;
}

.pages-wrapper {
    flex: 1;
    position: relative;
    will-change: transform;
}

/* Page Management */
.page {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.page.active {
    display: block;
}

/* ==========================
   HEADER COMPONENTS
   ========================== */

.header {
    position: sticky;
    top: 0;
    padding: 16px 20px;
    background: #1A1D29;
    border-bottom: 1px solid #2A2F3F;
    text-align: center;
    z-index: 100;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.header-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.sticky-header {
    position: sticky;
    top: 0;
    background: #1A1D29;
    z-index: 100;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    background: #1A1D29;
    border-bottom: 1px solid #2A2F3F;
    z-index: 100;
    height: 60px;
}

.detail-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.detail-header-bar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #1A1D29;
    border-bottom: 1px solid #2A2F3F;
    gap: 12px;
    z-index: 100;
    height: 60px;
}

.detail-header-bar h1 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    flex: 1;
    margin: 0;
}

.header-spacer {
    width: 36px;
}

.back-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #FF7F50;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 8px;
}

.back-btn:hover {
    background: rgba(255, 127, 80, 0.1);
}

.back-btn svg {
    width: 24px;
    height: 24px;
}

/* ==========================
   SECTION HEADERS
   ========================== */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

/* ==========================
   SCROLLABLE CONTENT
   ========================== */

.scrollable-content {
    background: #1A1D29;
}

/* ==========================
   BUTTONS
   ========================== */

.manage-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(156, 163, 184, 0.1);
    border: 1px solid rgba(156, 163, 184, 0.3);
    border-radius: 8px;
    color: #9CA3B8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.manage-button:hover {
    background: rgba(156, 163, 184, 0.15);
    border-color: rgba(156, 163, 184, 0.5);
    transform: translateY(-1px);
}

.manage-button:active {
    transform: translateY(0);
}

.manage-button svg {
    width: 16px;
    height: 16px;
}

.add-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 2px dashed #2A2F3F;
    border-radius: 12px;
    color: #9CA3B8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.add-button:hover {
    border-color: #FF7F50;
    color: #FF7F50;
    background: rgba(255, 127, 80, 0.05);
}

.add-button svg {
    width: 18px;
    height: 18px;
}

/* ==========================
   CARD COMPONENTS
   ========================== */

.action-card {
    flex: 1;
    background: #242938;
    border: 1px solid #2A2F3F;
    border-radius: 12px;
    padding: 14px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.action-card:hover {
    background: #2A2F3F;
    border-color: #FF7F50;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 127, 80, 0.25);
}

.action-card:active {
    transform: translateY(0);
}

.card-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 127, 80, 0.1);
    border: 1.5px solid rgba(255, 127, 80, 0.4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FF7F50;
    transition: all 0.3s;
}

.action-card:hover .card-icon {
    background: rgba(255, 127, 80, 0.2);
    border-color: #FF7F50;
}

.card-icon svg {
    width: 20px;
    height: 20px;
}

.card-label {
    font-size: 11px;
    font-weight: 600;
    color: #9CA3B8;
    text-align: center;
    transition: color 0.3s;
}

.action-card:hover .card-label {
    color: #FF7F50;
}

/* ==========================
   COIN COMPONENTS
   ========================== */

.coin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #242938;
    border-radius: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #2A2F3F;
}

.coin-item:hover {
    background: #2A2F3F;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.coin-logo {
    width: 44px;
    height: 44px;
    background: #2A2F3F;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.coin-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coin-info {
    flex: 1;
}

.coin-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.coin-network {
    font-size: 11px !important;
    font-weight: 500;
    color: #9CA3B8;
    background: rgba(156, 163, 184, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(156, 163, 184, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.coin-network-text {
    font-size: 15px;
    font-weight: 400;
    color: #9CA3B8;
}

.coin-fullname {
    font-size: 14px;
    font-weight: 400;
    color: #9CA3B8;
    margin-top: 4px;
}

.coin-rate {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rate-value {
    font-size: 13px;
    font-weight: 600;
    color: #9CA3B8;
}

.rate-change {
    font-size: 12px;
    font-weight: 600;
    position: relative;
    top: 1px;
}

.rate-change.positive {
    color: #22C55E;
}

.rate-change.negative {
    color: #EF4444;
}

.rate-change.neutral {
    color: #6B7088;
}

.coin-balance {
    text-align: right;
}

.balance-crypto {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.balance-usd {
    font-size: 13px;
    font-weight: 600;
    color: #9CA3B8;
}

/* ==========================
   TRANSACTION COMPONENTS
   ========================== */

.phantom-transaction {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #242938;
    border-radius: 12px;
    gap: 12px;
    margin-bottom: 8px;
    transition: background 0.2s;
    border: 1px solid #2A2F3F;
}

.phantom-transaction:hover {
    background: #2A2F3F;
}

.phantom-tx-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid #343A4D;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s;
}

.phantom-tx-icon svg {
    width: 20px;
    height: 20px;
    color: #6B7088;
    transition: color 0.2s;
}

.phantom-tx-icon.receive {
    border-color: rgba(34, 197, 94, 0.3);
}

.phantom-tx-icon.receive svg {
    color: #22C55E;
}

.phantom-tx-icon.send {
    border-color: rgba(239, 68, 68, 0.3);
}

.phantom-tx-icon.send svg {
    color: #EF4444;
}

.phantom-tx-icon.exchange {
    border-color: rgba(255, 127, 80, 0.3);
}

.phantom-tx-icon.exchange svg {
    color: #FF7F50;
}

.phantom-tx-icon.transfer {
    border-color: rgba(234, 179, 8, 0.3);
}

.phantom-tx-icon.transfer svg {
    color: #EAB308;
}

.phantom-transaction:hover .phantom-tx-icon {
    transform: scale(1.05);
}

.phantom-tx-info {
    flex: 1;
}

.phantom-tx-type {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
    margin-bottom: 4px;
}

.phantom-tx-time {
    font-size: 13px;
    color: #6B7088;
}

.phantom-tx-amount {
    text-align: right;
}

.phantom-tx-value {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
    margin-bottom: 4px;
}

.phantom-tx-value.positive {
    color: #22C55E;
}

.phantom-tx-value.negative {
    color: #EF4444;
}

.phantom-tx-status {
    font-size: 12px;
    color: #6B7088;
    text-transform: capitalize;
}

/* ==========================
   EMPTY STATES
   ========================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.empty-state.hidden {
    display: none;
}

.empty-title {
    font-size: 16px;
    font-weight: 500;
    color: #6B7088;
}

.empty-subtitle {
    font-size: 14px;
    color: #6B7088;
}

.empty-icon {
    width: 64px;
    height: 64px;
    color: #343A4D;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    font-weight: 600;
    color: #9CA3B8;
    margin-bottom: 8px;
}

/* ==========================
   BOTTOM NAVIGATION
   ========================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: space-around;
    padding: 10px 20px 16px;
    background: linear-gradient(180deg, transparent 0%, #1A1D29 15%, #1A1D29 100%);
    border-top: 1px solid #2A2F3F;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #6B7088;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px 16px;
    border-radius: 8px;
    min-width: 80px;
}

.nav-item:hover {
    background: rgba(255, 127, 80, 0.08);
    color: #9CA3B8;
}

.nav-item.active {
    color: #FF7F50;
}

.nav-item.active:hover {
    background: rgba(255, 127, 80, 0.12);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

/* ==========================
   UTILITY COMPONENTS
   ========================== */

.stats-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
}

.stats-badge.neutral {
    background: rgba(107, 112, 136, 0.12);
    border: 1px solid rgba(107, 112, 136, 0.3);
}

.value-text {
    font-size: 14px;
    font-weight: 700;
    color: #22C55E;
    letter-spacing: -0.2px;
}

.stats-badge.neutral .value-text {
    color: #6B7088;
}

/* Limited Badge */
.limited-badge {
    font-size: 11px;
    font-weight: 600;
    color: #FF7F50;
    background: rgba(255, 127, 80, 0.15);
    border: 1px solid rgba(255, 127, 80, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 127, 80, 0.08);
    border: 1px solid rgba(255, 127, 80, 0.2);
    border-radius: 12px;
}

.info-box-icon {
    width: 20px;
    height: 20px;
    color: #FF7F50;
    flex-shrink: 0;
}

.info-box-icon svg {
    width: 100%;
    height: 100%;
}

.info-box-text {
    flex: 1;
    font-size: 13px;
    font-weight: 400;
    color: #FF7F50;
    line-height: 1.5;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    background: #2A2F3F;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-switch.active {
    background: #FF7F50;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* ==========================
   TOAST NOTIFICATIONS
   ========================== */

.success-toast {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
    z-index: 1000;
    transition: top 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-toast.error {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.success-toast.show {
    top: 60px;
}

.toast-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.toast-text {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.toast-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.toast-close:active {
    transform: scale(0.9);
}

.toast-close svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 2.5;
}
