/* =====================================
   Currency Converter - ToolHub TH
===================================== */

.currency-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 35px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.currency-container h1 {
    text-align: center;
    color: #2563eb;
    margin-bottom: 12px;
}

.subtitle {
    text-align: center;
    color: #666;
    line-height: 1.8;
    margin-bottom: 35px;
}

/* =====================================
   Converter Card
===================================== */

.converter-card {
    background: #f8fafc;
    padding: 30px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #222;
}

.input-group input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 12px;
    transition: .25s;
    box-sizing: border-box;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

/* =====================================
   Currency Row
===================================== */

.currency-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 18px;
    align-items: end;
    margin-bottom: 30px;
}

.currency-box {
    display: flex;
    flex-direction: column;
}

.currency-box label {
    margin-bottom: 8px;
    font-weight: 600;
}

.currency-box select {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
    cursor: pointer;
    transition: .25s;
    font-family: inherit;
}

.currency-box select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

/* =====================================
   Swap Button
===================================== */

.swap-btn {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: transform .3s ease, background-color .25s ease;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    background: #1d4ed8;
    transform: rotate(180deg) scale(1.08);
}

.swap-btn:active {
    transform: scale(.95);
}

/* =====================================
   Convert Button
===================================== */

#convertBtn {
    width: 100%;
    padding: 16px;
    margin-top: 10px;
    border: none;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: .25s;
    font-family: inherit;
}

#convertBtn:hover {
    background: #1d4ed8;
}

#convertBtn:active {
    transform: scale(.98);
}

/* =====================================
   Result Card
===================================== */

.result-card {
    margin-top: 35px;
    padding: 30px;
    background: #f8fafc;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.result-card h2 {
    color: #2563eb;
    margin-bottom: 20px;
}

.result-value {
    font-size: 42px;
    font-weight: 700;
    color: #16a34a;
    margin-bottom: 15px;
    word-break: break-word;
}

.result-text {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

/* =====================================
   Exchange Info
===================================== */

.exchange-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.info-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.info-box h3 {
    color: #2563eb;
    margin-bottom: 10px;
    font-size: 18px;
}

.info-box p {
    color: #444;
    font-weight: 600;
    word-break: break-word;
}

/* =====================================
   Action Buttons
===================================== */

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.secondary-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    background: #e5e7eb;
    color: #222;
    font-weight: 600;
    cursor: pointer;
    transition: .25s;
    font-family: inherit;
}

.secondary-btn:hover {
    background: #d1d5db;
}

/* =====================================
   Information Section
===================================== */

.currency-info {
    margin-top: 45px;
    padding: 28px;
    background: #f8fafc;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
}

.currency-info h2 {
    color: #2563eb;
    margin-bottom: 18px;
}

.currency-info p {
    color: #555;
    line-height: 1.9;
    margin-bottom: 15px;
}

/* =====================================
   Popular Currency
===================================== */

.popular-section {
    margin-top: 45px;
}

.popular-section h2 {
    text-align: center;
    margin-bottom: 22px;
    color: #2563eb;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px;
}

.popular-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: .25s;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .05);
}

.popular-item:hover {
    background: #2563eb;
    color: #fff;
    transform: translateY(-4px);
}

/* =====================================
   FAQ
===================================== */

.faq {
    margin-top: 50px;
}

.faq h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2563eb;
}

.faq-item {
    background: #fff;
    padding: 22px;
    margin-bottom: 18px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

.faq-item h3 {
    color: #2563eb;
    margin-bottom: 10px;
}

.faq-item p {
    color: #555;
    line-height: 1.8;
}

/* =====================================
   Related Tools
===================================== */

.related-tools {
    margin-top: 50px;
}

.related-tools h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2563eb;
}

.related-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.related-links a {
    display: block;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    transition: .25s;
}

.related-links a:hover {
    background: #1d4ed8;
    transform: translateY(-3px);
}

/* =====================================
   Animation
===================================== */

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

.currency-container {
    animation: fadeUp .5s ease;
}

.result-card {
    animation: fadeUp .35s ease;
}

/* =====================================
   Utility
===================================== */

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

.hidden {
    display: none !important;
}

/* =====================================
   Responsive
===================================== */

@media (max-width: 992px) {
    .currency-container {
        margin: 30px 20px;
        padding: 28px;
    }
}

@media (max-width: 768px) {
    .currency-container {
        padding: 22px;
    }

    .currency-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .swap-btn {
        width: 50px;
        height: 50px;
        margin: 5px auto;
        transform: rotate(90deg);
    }

    .swap-btn:hover {
        transform: rotate(270deg) scale(1.05);
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .secondary-btn {
        width: 100%;
    }

    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 480px) {
    .currency-container {
        margin: 15px;
        padding: 18px;
    }

    .currency-container h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 15px;
    }

    .converter-card {
        padding: 18px;
    }

    .input-group input {
        font-size: 16px;
    }

    .currency-box select {
        font-size: 15px;
    }

    #convertBtn {
        font-size: 18px;
    }

    .result-value {
        font-size: 30px;
    }

    .result-text {
        font-size: 16px;
    }

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