* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(0, 255, 150, 0.16), transparent 35%),
        radial-gradient(circle at top right, rgba(0, 140, 255, 0.12), transparent 35%),
        #050b08;
    color: #f5f5f5;
}

.container {
    max-width: 1180px;
    margin: auto;
    padding: 18px;
}

.header {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 10px;
}

.header h1 {
    color: #3cff9b;
    font-size: 34px;
    margin-bottom: 6px;
}

.header p {
    color: #a7b8af;
    margin: 0;
}

.search-box,
.price-card,
.card,
.chart-card,
.explain-card {
    background: rgba(16, 28, 23, 0.96);
    border: 1px solid #244d39;
    border-radius: 22px;
    padding: 18px;
}

.search-box {
    padding: 20px;
}

form {
    display: flex;
    gap: 10px;
}

input {
    flex: 1;
    padding: 15px;
    border-radius: 13px;
    border: 1px solid #2c5e45;
    background: #07110d;
    color: #fff;
    font-size: 17px;
    outline: none;
}

button,
.switch-btn {
    padding: 15px 22px;
    border: none;
    border-radius: 13px;
    background: linear-gradient(135deg, #00c46a, #3cff9b);
    color: #03110a;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

.switch-btn {
    padding: 10px 14px;
    font-size: 14px;
    opacity: 0.65;
}

.switch-btn.active {
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(60,255,155,0.35);
}

.result {
    margin-top: 25px;
}

.price-card {
    margin-bottom: 18px;
}

.price-top {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.price-card h2 {
    margin: 0;
    color: #3cff9b;
    font-size: 26px;
}

.price {
    font-size: 38px;
    font-weight: bold;
    margin-top: 10px;
}

.daily-change {
    margin-top: 10px;
    font-size: 18px;
    font-weight: bold;
    display: inline-block;
    padding: 8px 14px;
    border-radius: 12px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.card {
    min-height: 170px;
}

.card h3,
.chart-head h3,
.explain-card h3 {
    margin-top: 0;
    color: #d7ffe8;
    font-size: 18px;
}

.value {
    font-size: 25px;
    font-weight: bold;
    margin: 12px 0;
}

.card p,
.chart-head p,
.explain-card p {
    color: #a7b8af;
    margin: 8px 0 12px;
    font-size: 14px;
    line-height: 1.45;
}

.badge {
    display: inline-block;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

.buy {
    background: rgba(0, 255, 140, 0.15);
    color: #3cff9b;
    border: 1px solid #3cff9b;
}

.sell {
    background: rgba(255, 70, 70, 0.15);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

.neutral {
    background: rgba(255, 210, 80, 0.15);
    color: #ffd666;
    border: 1px solid #ffd666;
}

.chart-card,
.explain-card {
    margin-top: 18px;
}

.chart-head {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.switch-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#graficoPrecio {
    width: 100%;
    height: 430px;
    max-height: 430px;
}

.error {
    margin-top: 20px;
    background: #2a1010;
    border: 1px solid #ff6b6b;
    color: #ffb3b3;
    padding: 15px;
    border-radius: 14px;
}

.footer {
    margin-top: 25px;
    color: #7d9188;
    font-size: 13px;
    text-align: center;
}

@media(max-width: 1050px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 650px) {
    .container {
        padding: 13px;
    }

    .header h1 {
        font-size: 26px;
    }

    form {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .price {
        font-size: 31px;
    }

    #graficoPrecio {
        height: 360px;
    }
}

.small-value {
    font-size: 24px;
    line-height: 1.2;
}

.source-line {
    margin: -4px 0 10px;
    font-size: 12px;
    color: #8a94a6;
}


/* Ayuda interactiva para PER, RSI y MACD */
.help-card {
    cursor: pointer;
    position: relative;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.help-card:hover {
    transform: translateY(-2px);
    border-color: rgba(60, 255, 155, .55);
    box-shadow: 0 12px 28px rgba(0,0,0,.28);
    background: linear-gradient(180deg, rgba(60,255,155,.10), rgba(255,255,255,.035));
}

.help-card:hover h3,
.help-card:hover .value {
    color: #3cff9b;
}

.help-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.72);
    z-index: 9999;
    padding: 18px;
    align-items: center;
    justify-content: center;
}

.help-modal.show {
    display: flex;
}

.help-modal-box {
    width: min(560px, 100%);
    background: #101b16;
    border: 1px solid rgba(60,255,155,.25);
    border-radius: 20px;
    padding: 22px;
    color: #d7ffe8;
    box-shadow: 0 22px 70px rgba(0,0,0,.55);
    position: relative;
}

.help-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.help-modal-box h3 {
    margin: 0 40px 12px 0;
}

.help-modal-box ul {
    padding-left: 20px;
    margin: 10px 0;
}

.help-modal-box li {
    margin-bottom: 8px;
}

.help-note {
    margin-top: 12px;
    color: #aabbb3;
    font-size: 14px;
}
