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

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

.bg-orbs {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px; height: 400px;
    background: #6c5ce7;
    top: -100px; left: -100px;
}

.orb-2 {
    width: 300px; height: 300px;
    background: #00d2ff;
    bottom: 100px; right: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 250px; height: 250px;
    background: #fd6a9d;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(10px, 10px) scale(1.02); }
}

.glass-header {
    text-align: center;
    padding: 30px 20px 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

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

.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 16px 12px;
    margin: 16px 16px 8px;
    border-radius: 16px;
}

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

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

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

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.search-container {
    margin: 8px 16px 16px;
    padding: 4px;
    border-radius: 14px;
}

.search-container input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    padding: 12px 16px;
    outline: none;
    border-radius: 10px;
}

.search-container input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

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

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

.crypto-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.crypto-card:active {
    transform: scale(0.98);
}

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

.coin-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
}

.coin-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.coin-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    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-wrap {
    text-align: right;
}

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

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

.positive { color: #00e676; }
.negative { color: #ff5252; }

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

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

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

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

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

.modal-content {
    width: 100%;
    max-width: 500px;
    border-radius: 24px 24px 0 0;
    padding: 28px 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    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;
}

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

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
}

.modal-icon img {
    width: 100%;
    height: 100%;
}

.modal-title h2 {
    font-size: 1.3rem;
    color: #fff;
}

.modal-title span {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}

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

.detail-item {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 14px;
}

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

.detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.rank-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6c5ce7, #00d2ff);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

@media (min-width: 600px) {
    .crypto-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .modal-overlay {
        align-items: center;
    }
    .modal-content {
        border-radius: 24px;
        transform: translateY(20px) scale(0.95);
    }
    .modal-overlay.active .modal-content {
        transform: translateY(0) scale(1);
    }
}
