* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0e1a;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 30px;
}

.bg-orbs {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    filter: blur(80px);
}

.orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
}

.orb-1 {
    width: 300px; height: 300px;
    background: #6c63ff;
    top: -50px; left: -50px;
    animation: float 8s ease-in-out infinite;
}

.orb-2 {
    width: 250px; height: 250px;
    background: #00d4ff;
    top: 30%; right: -80px;
    animation: float 10s ease-in-out infinite reverse;
}

.orb-3 {
    width: 200px; height: 200px;
    background: #ff6b9d;
    bottom: 10%; left: 10%;
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.glass-header {
    text-align: center;
    padding: 24px 20px 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6c63ff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 4px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.stats-section {
    margin: 16px 16px 12px;
    padding: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.search-section {
    margin: 0 16px 12px;
    padding: 4px;
}

#searchInput {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

#searchInput:focus {
    border-color: rgba(108, 99, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.crypto-list {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(108, 99, 255, 0.2);
    border-top-color: #6c63ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.crypto-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes slideIn {
    to { opacity: 1; transform: translateY(0); }
}

.crypto-card:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.1);
}

.rank-num {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    width: 28px;
    flex-shrink: 0;
}

.coin-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

.coin-info {
    flex: 1;
    min-width: 0;
}

.coin-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coin-symbol {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.coin-price-section {
    text-align: right;
    flex-shrink: 0;
}

.coin-price {
    font-weight: 600;
    font-size: 0.9rem;
}

.coin-change {
    font-size: 0.8rem;
    font-weight: 500;
}

.positive { color: #4ade80; }
.negative { color: #f87171; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.detail-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
}

.detail-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.detail-symbol {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
}

.detail-price {
    font-size: 1.6rem;
    font-weight: 700;
}

.detail-change {
    font-size: 1rem;
    font-weight: 500;
}

.detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-stat {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.detail-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 0.85rem; }
}
