/* KursRupiah Complete Styles v1.0.4 */

:root {
    --kr-primary: #2563eb;
    --kr-primary-dark: #1e40af;
    --kr-secondary: #64748b;
    --kr-success: #10b981;
    --kr-warning: #f59e0b;
    --kr-danger: #ef4444;
    --kr-light: #f8fafc;
    --kr-dark: #0f172a;
    --kr-border: #e2e8f0;
    --kr-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --kr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --kr-gold: #fbbf24;
    --kr-gold-dark: #d97706;
    --kr-silver: #9ca3af;
    --kr-silver-dark: #6b7280;
}

* {
    box-sizing: border-box;
}

.kursrupiah-homepage {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.kursrupiah-homepage h1 {
    font-size: 2.5rem;
    text-align: center;
    color: #111827;
    margin-bottom: 30px;
}

/* Enhanced Main Rate Card */
.kr-main-rate {
    background: linear-gradient(135deg, var(--kr-primary) 0%, var(--kr-primary-dark) 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: var(--kr-shadow-lg);
    position: relative;
    overflow: hidden;
}

.kr-main-rate::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.kr-rate-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.kr-flag-hero {
    font-size: 72px;
    line-height: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.kr-main-rate h2 {
    font-size: 2rem;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.kr-rate-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.kr-rate {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 20px 0;
    letter-spacing: -2px;
    text-align: center;
}

.kr-unit-text {
    font-size: 1.2rem;
    opacity: 0.8;
    font-weight: 400;
}

.kr-rate-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.kr-rate-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.kr-rate-meta svg {
    opacity: 0.9;
}

/* Table Styles with Enhanced UI */
.kr-filter-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--kr-border);
    padding-bottom: 10px;
}

.kr-tab {
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--kr-border);
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--kr-secondary);
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.kr-tab:hover {
    background: var(--kr-light);
    color: var(--kr-primary);
}

.kr-tab.active {
    background: white;
    color: var(--kr-primary);
    border-color: var(--kr-primary);
    border-bottom-color: var(--kr-primary);
}

.kr-table-responsive {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: var(--kr-shadow);
}

.kr-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

.kr-table thead {
    background: linear-gradient(135deg, var(--kr-primary) 0%, var(--kr-primary-dark) 100%);
    color: white;
}

.kr-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kr-table td {
    padding: 16px;
    border-top: 1px solid var(--kr-border);
    vertical-align: middle;
}

.kr-table tbody tr {
    transition: all 0.2s ease;
}

.kr-table tbody tr:hover {
    background: var(--kr-light);
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--kr-primary);
}

.kr-currency-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.kr-currency-link:hover .kr-currency-info strong {
    color: var(--kr-primary);
}

.kr-currency-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kr-flag {
    font-size: 28px;
    line-height: 1;
}

.kr-flag-large {
    font-size: 48px;
    line-height: 1;
}

.kr-currency-info strong {
    display: block;
    font-size: 16px;
    color: var(--kr-dark);
    margin-bottom: 4px;
}

.kr-currency-info small {
    color: var(--kr-secondary);
    font-size: 13px;
}

.kr-country-cell {
    line-height: 1.4;
}

.kr-country-cell small {
    display: block;
    color: var(--kr-secondary);
    font-size: 12px;
    margin-top: 4px;
}

.kr-rate-value {
    font-size: 18px;
    color: var(--kr-primary);
    font-weight: 700;
}

.kr-unit {
    font-size: 12px;
    color: var(--kr-secondary);
    font-weight: 400;
}

.kr-source-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.kr-source-badge.official {
    background: #dcfce7;
    color: #166534;
}

.kr-source-badge.secondary {
    background: #dbeafe;
    color: #1e40af;
}

.kr-desktop-only {
    display: table-cell;
}

.kr-mobile-only {
    display: none;
}

.kr-converter {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-converter h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #111827;
}

.kursrupiah-converter {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.kursrupiah-converter input,
.kursrupiah-converter select {
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
}

.kursrupiah-converter input[type="number"] {
    width: 150px;
}

.kursrupiah-converter select {
    width: 120px;
}

.kursrupiah-converter input[readonly] {
    background: #f3f4f6;
    font-weight: 600;
    color: #2563eb;
    width: 200px;
}

/* Enhanced Chart Styles */
.kursrupiah-chart-container {
    background: white;
    padding: 24px;
    border-radius: 16px;
    margin: 30px 0;
    box-shadow: var(--kr-shadow-lg);
    border: 1px solid var(--kr-border);
    position: relative;
}

.kursrupiah-chart-container.kr-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    z-index: 10;
}

.kursrupiah-chart-container.kr-loading::before {
    content: 'Memuat data...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    font-size: 16px;
    color: #2563eb;
    font-weight: 600;
}

.kr-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.kr-chart-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kr-chart-title h3 {
    margin: 0;
    font-size: 24px;
    color: var(--kr-dark);
}

.kr-chart-subtitle {
    margin: 4px 0 0 0;
    color: var(--kr-secondary);
    font-size: 14px;
}

.kr-chart-period-selector {
    display: flex;
    gap: 6px;
    background: var(--kr-light);
    padding: 4px;
    border-radius: 8px;
}

.kr-period-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--kr-secondary);
    transition: all 0.2s ease;
}

.kr-period-btn:hover {
    background: white;
    color: var(--kr-primary);
}

.kr-period-btn.active {
    background: var(--kr-primary);
    color: white;
    box-shadow: var(--kr-shadow);
}

.kursrupiah-chart-container canvas {
    max-height: 450px;
    margin-top: 20px;
}

.kr-chart-responsive-wrapper {
    height: 400px;
    /* Default desktop height */
}

/* Widget Styles */
.kursrupiah-widget {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-widget-rate {
    text-align: center;
    margin-bottom: 15px;
}

.kr-widget-rate strong {
    display: block;
    font-size: 1.1rem;
    color: #111827;
    margin-bottom: 10px;
}

.kr-rate-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
    margin: 10px 0;
}

.kr-widget-rate small {
    display: block;
    color: #6b7280;
    font-size: 0.85rem;
}

.kr-widget-converter {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.kr-widget-input {
    padding: 8px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    width: 80px;
    font-size: 0.9rem;
}

.kr-widget-result {
    font-weight: 600;
    color: #2563eb;
}

.kr-widget-link {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.kr-widget-link a {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.85rem;
}

.kr-widget-link a:hover {
    text-decoration: underline;
}

/* Currency Page Styles */
.kursrupiah-currency-page,
.kursrupiah-amount-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.kr-currency-header {
    text-align: center;
    margin-bottom: 40px;
}

.kr-currency-header h1 {
    font-size: 2.5rem;
    color: #111827;
    margin-bottom: 10px;
    line-height: 1.3;
}

.kr-currency-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    line-height: 1.6;
}

/* Intro Section */
.kr-intro-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-intro-section p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.kr-flag-image-container {
    text-align: center;
    margin: 20px 0;
}

.kr-flag-hero-xl {
    font-size: 128px;
    line-height: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Current Rate Box */
.kr-current-rate-box {
    background: var(--kr-light);
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
    border-left: 4px solid var(--kr-primary);
}

.kr-current-rate-box h3 {
    margin-top: 0;
    color: var(--kr-dark);
    font-size: 1.25rem;
}

.kr-current-rate-box p {
    margin: 12px 0;
    font-size: 1.05rem;
}

/* Conversion Table Section */
.kr-conversion-table-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-conversion-table-section h2 {
    margin-top: 0;
    color: #111827;
}

.kr-conversion-table,
.kr-stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--kr-border);
    border-radius: 8px;
    overflow: hidden;
}

.kr-conversion-table thead {
    background: linear-gradient(135deg, var(--kr-primary) 0%, var(--kr-primary-dark) 100%);
    color: white;
}

.kr-conversion-table th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
}

.kr-conversion-table td,
.kr-stats-table td {
    padding: 12px 20px;
    border-top: 1px solid var(--kr-border);
}

.kr-conversion-table tbody tr:hover {
    background: var(--kr-light);
}

/* Currency Stats */
.kr-currency-stats {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-currency-stats h2 {
    margin-top: 0;
    color: #111827;
}

.kr-stats-table tbody tr:nth-child(odd) {
    background: var(--kr-light);
}

.kr-stats-table td:first-child {
    font-weight: 600;
    color: var(--kr-dark);
    width: 30%;
}

/* FAQ Section */
.kr-faq-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-faq-section h3 {
    margin-top: 0;
    color: #111827;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.kr-faq-list {
    display: grid;
    gap: 16px;
}

.kr-faq-item {
    padding: 16px;
    background: var(--kr-light);
    border-radius: 8px;
    border-left: 3px solid var(--kr-primary);
}

.kr-faq-item p {
    margin: 8px 0;
}

.kr-faq-item p:first-child {
    color: var(--kr-dark);
    margin-bottom: 8px;
}

.kr-currency-main {
    display: grid;
    gap: 30px;
}

.kr-converter-section,
.kr-currency-info,
.kr-other-rates {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-currency-info h3,
.kr-other-rates h3 {
    margin-top: 0;
    color: #111827;
}

.kr-other-currencies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.kr-currency-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.kr-currency-card:hover {
    background: #f3f4f6;
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.kr-currency-card a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
}

.kr-card-flag {
    font-size: 36px;
    line-height: 1;
}

.kr-currency-card strong {
    color: #111827;
    font-size: 1.1rem;
    font-weight: 700;
}

.kr-card-name {
    color: #6b7280;
    font-size: 0.85rem;
    display: block;
}

.kr-card-rate {
    color: #2563eb;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 4px;
}

/* Loading State */
.kr-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.kr-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--kr-primary);
    border-radius: 50%;
    animation: kr-spin 1s linear infinite;
}

@keyframes kr-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Smooth animations */
.kr-fade-in {
    animation: krFadeIn 0.5s ease-in;
}

@keyframes krFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Print styles */
@media print {

    .kr-filter-tabs,
    .kr-chart-period-selector,
    .kr-widget-link,
    .kr-embed-footer {
        display: none !important;
    }

    .kursrupiah-chart-container {
        break-inside: avoid;
    }
}

@media (max-width: 768px) {

    .kursrupiah-converter input:not([type="checkbox"]):not([type="radio"]),
    .kursrupiah-converter select {
        width: 100% !important;
        margin-bottom: 10px;
    }

    .kursrupiah-converter span {
        display: block;
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }

    .kursrupiah-converter {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Embed Widget Styles */
.kr-embed-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    max-width: 300px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-embed-header {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    text-align: center;
}

.kr-embed-rate,
.kr-embed-current {
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
    text-align: center;
    margin: 12px 0;
}

.kr-embed-meta {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 12px;
}

.kr-embed-footer {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.kr-embed-footer a {
    color: #2563eb;
    text-decoration: none;
    font-size: 12px;
}

.kr-embed-footer a:hover {
    text-decoration: underline;
}

.kr-embed-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.kr-embed-table th {
    text-align: left;
    padding: 8px;
    background: #f3f4f6;
    font-weight: 600;
}

.kr-embed-table td {
    padding: 8px;
    border-top: 1px solid #e5e7eb;
}

.kr-embed-widget.table {
    max-width: 400px;
}

#kr-embed-chart {
    max-height: 200px;
    margin: 12px 0;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {

    /* Homepage */
    .kursrupiah-homepage {
        padding: 12px;
    }

    .kursrupiah-homepage h1 {
        font-size: 1.75rem;
    }

    /* Currency & Amount Pages */
    .kursrupiah-currency-page,
    .kursrupiah-amount-page {
        padding: 12px;
    }

    .kr-currency-header h1,
    .kr-amount-header h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        padding: 0 10px;
    }

    .kr-currency-subtitle,
    .kr-amount-subtitle {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    /* Main Rate Card */
    .kr-main-rate {
        padding: 24px 20px;
    }

    .kr-rate {
        font-size: 2rem;
    }

    .kr-rate-header {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        text-align: center;
    }

    .kr-rate-header h2 {
        font-size: 1.5rem;
    }

    .kr-rate-subtitle {
        font-size: 0.9rem;
    }

    .kr-flag-hero {
        font-size: 48px;
    }

    .kr-flag-hero-xl {
        font-size: 96px;
    }

    .kr-rate-meta {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .kr-source-badge,
    .kr-update-time {
        font-size: 0.8rem;
    }

    /* Sections */
    .kr-intro-section,
    .kr-converter-section,
    .kr-conversion-table-section,
    .kr-currency-stats,
    .kr-currency-info,
    .kr-faq-section,
    .kr-other-rates {
        padding: 20px;
        margin-bottom: 20px;
    }

    .kr-intro-section p {
        font-size: 0.95rem;
    }

    /* Tables */
    .kr-conversion-table th,
    .kr-conversion-table td,
    .kr-stats-table td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .kr-conversion-table th {
        font-size: 13px;
    }

    /* Current Rate Box */
    .kr-current-rate-box {
        padding: 16px;
        margin-top: 16px;
    }

    .kr-current-rate-box h3 {
        font-size: 1rem;
    }

    .kr-current-rate-box p {
        font-size: 0.95rem;
    }

    /* FAQ */
    .kr-faq-item {
        padding: 12px;
    }

    .kr-faq-section h3 {
        font-size: 1.25rem;
    }

    .kr-filter-tabs {
        gap: 6px;
    }

    .kr-tab {
        padding: 8px 12px;
        font-size: 13px;
    }

    .kr-table-responsive {
        margin: 15px -12px;
        border-radius: 0;
    }

    .kr-table {
        min-width: 100%;
    }

    .kr-table th,
    .kr-table td {
        padding: 12px 8px;
    }

    .kr-desktop-only {
        display: none !important;
    }

    .kr-mobile-only {
        display: block;
    }

    .kr-currency-cell {
        gap: 8px;
    }

    .kr-flag {
        font-size: 24px;
    }

    .kr-currency-info strong {
        font-size: 14px;
    }

    .kr-rate-value {
        font-size: 16px;
    }

    .kursrupiah-converter {
        flex-direction: column;
        align-items: stretch;
    }

    .kursrupiah-converter input,
    .kursrupiah-converter select {
        width: 100%;
    }

    .kr-chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .kr-chart-title {
        gap: 12px;
    }

    .kr-flag-large {
        font-size: 36px;
    }

    .kr-chart-title h3 {
        font-size: 20px;
    }

    .kr-chart-period-selector {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .kr-period-btn {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .kursrupiah-chart-container {
        padding: 16px;
    }

    .kursrupiah-chart-container canvas {
        max-height: 280px;
    }

    .kr-chart-responsive-wrapper {
        height: auto !important;
        min-height: 200px;
    }

    .kr-chart-section {
        min-height: auto !important;
        height: auto !important;
        margin-bottom: 15px !important;
        display: block !important;
    }

    .all-time-chart-container,
    .kursrupiah-chart-container {
        height: auto !important;
        min-height: auto !important;
        margin-bottom: 0 !important;
    }

    /* Other Currencies Grid */
    .kr-other-currencies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .kr-currency-card {
        font-size: 0.9rem;
    }

    .kr-card-flag {
        font-size: 32px;
    }

    .kr-card-rate {
        font-size: 0.95rem;
    }

    /* Amount Pages Specific */
    .kr-amount-main-box {
        padding: 24px 16px;
    }

    .kr-amount-value {
        font-size: 2rem;
    }

    .kr-amount-description {
        font-size: 0.95rem;
    }

    /* Precious Metals Pages */
    .kr-gold-price-table,
    .kr-metals-main>div {
        padding: 20px !important;
    }

    .kr-metals-header h1 {
        font-size: 1.75rem;
    }

    .kr-metals-subtitle {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {

    /* Ultra Small Mobile */
    .kursrupiah-homepage,
    .kursrupiah-currency-page,
    .kursrupiah-amount-page,
    .kursrupiah-metals-page {
        padding: 8px;
    }

    .kr-currency-header h1,
    .kr-amount-header h1,
    .kr-metals-header h1 {
        font-size: 1.5rem;
        padding: 0 5px;
    }

    .kr-currency-subtitle,
    .kr-amount-subtitle,
    .kr-metals-subtitle {
        font-size: 0.85rem;
    }

    .kr-main-rate {
        padding: 20px 15px;
    }

    .kr-rate {
        font-size: 1.75rem;
    }

    .kr-rate-header h2 {
        font-size: 1.25rem;
    }

    .kr-flag-hero {
        font-size: 40px;
    }

    .kr-flag-hero-xl {
        font-size: 72px;
    }

    .kr-intro-section,
    .kr-converter-section,
    .kr-conversion-table-section,
    .kr-currency-stats,
    .kr-currency-info,
    .kr-faq-section,
    .kr-other-rates,
    .kr-gold-price-table {
        padding: 15px !important;
    }

    .kr-tab {
        padding: 6px 10px;
        font-size: 12px;
    }

    .kr-table th,
    .kr-table td,
    .kr-conversion-table th,
    .kr-conversion-table td,
    .kr-stats-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .kr-conversion-table th {
        font-size: 12px;
    }

    .kr-period-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .kursrupiah-chart-container {
        padding: 12px;
    }

    .kursrupiah-chart-container canvas {
        max-height: 240px;
    }

    .kr-other-currencies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .kr-currency-card {
        padding: 10px;
        font-size: 0.85rem;
    }

    .kr-card-flag {
        font-size: 28px;
    }

    .kr-faq-item {
        padding: 10px;
    }

    .kr-faq-item p {
        font-size: 0.9rem;
    }
}

@media (min-width: 1200px) {
    .kursrupiah-homepage {
        padding: 40px;
    }

    .kr-table th,
    .kr-table td {
        padding: 18px 20px;
    }

    .kursrupiah-chart-container canvas {
        max-height: 500px;
    }

    .kr-chart-responsive-wrapper {
        height: 450px;
    }
}

/* Amount-Specific Pages */
.kr-amount-header {
    text-align: center;
    margin-bottom: 40px;
}

.kr-amount-header h1 {
    font-size: 2.5rem;
    color: #111827;
    margin-bottom: 10px;
    line-height: 1.3;
}

.kr-amount-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    line-height: 1.6;
}

.kr-quick-answer {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.kr-quick-answer::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.kr-answer-flag {
    font-size: 96px;
    line-height: 1;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.kr-quick-answer h2 {
    font-size: 1.5rem;
    margin: 0 0 20px 0;
    opacity: 0.95;
}

.kr-answer-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.kr-amount-input {
    font-size: 2.5rem;
    font-weight: 700;
}

.kr-equals {
    font-size: 2rem;
    opacity: 0.8;
}

.kr-amount-result {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.kr-answer-meta {
    margin-top: 20px;
    opacity: 0.9;
    font-size: 14px;
    line-height: 1.6;
}

.kr-ai-content-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.kr-ai-content-section h2 {
    color: #111827;
    font-size: 1.75rem;
    margin-top: 30px;
    margin-bottom: 15px;
}

.kr-ai-content-section h2:first-child {
    margin-top: 0;
}

.kr-ai-content-section ul {
    padding-left: 30px;
    margin: 15px 0;
}

.kr-ai-content-section li {
    margin: 10px 0;
}

.kr-related-amounts {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-related-amounts h3 {
    margin-top: 0;
    color: #111827;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.kr-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.kr-related-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--kr-light);
    border: 2px solid var(--kr-border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.kr-related-card:hover {
    border-color: var(--kr-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.15);
}

.kr-related-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--kr-dark);
    margin-bottom: 8px;
}

.kr-related-equals {
    font-size: 1rem;
    color: var(--kr-secondary);
    margin-bottom: 8px;
}

.kr-related-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--kr-primary);
}

.kr-converter-widget {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kr-converter-widget h3 {
    margin-top: 0;
    color: #111827;
}

.kr-back-link {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.kr-btn-primary,
.kr-btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.kr-btn-primary {
    background: var(--kr-primary);
    color: white;
}

.kr-btn-primary:hover {
    background: var(--kr-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.kr-btn-secondary {
    background: white;
    color: var(--kr-primary);
    border: 2px solid var(--kr-primary);
}

.kr-btn-secondary:hover {
    background: var(--kr-light);
}

.kr-detail-link {
    color: var(--kr-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.kr-detail-link:hover {
    text-decoration: underline;
}

.kr-faq-link {
    color: var(--kr-dark);
    text-decoration: none;
}

.kr-faq-link:hover {
    color: var(--kr-primary);
    text-decoration: underline;
}

.kr-faq-readmore {
    display: inline-block;
    margin-top: 8px;
    color: var(--kr-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.kr-faq-readmore:hover {
    text-decoration: underline;
}

/* Responsive for amount pages */
@media (max-width: 768px) {
    .kr-amount-header h1 {
        font-size: 1.75rem;
    }

    .kr-quick-answer {
        padding: 30px 20px;
    }

    .kr-answer-flag {
        font-size: 72px;
    }

    .kr-amount-input {
        font-size: 1.75rem;
    }

    .kr-amount-result {
        font-size: 2rem;
    }

    .kr-answer-value {
        gap: 10px;
    }

    .kr-ai-content-section {
        padding: 24px;
    }

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

    .kr-back-link {
        flex-direction: column;
    }

    .kr-btn-primary,
    .kr-btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   PRECIOUS METALS PAGES (Gold & Silver)
   ============================================ */

.kursrupiah-metals-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.kr-metals-content {
    background: white;
}

.kr-metals-header {
    text-align: center;
    margin-bottom: 40px;
}

.kr-metals-header h1 {
    font-size: 2.5rem;
    color: #111827;
    margin-bottom: 20px;
    line-height: 1.2;
}

.kr-metals-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Gold Rate Card */
.kr-gold-rate {
    background: linear-gradient(135deg, var(--kr-gold) 0%, var(--kr-gold-dark) 100%);
}

/* Silver Rate Card */
.kr-silver-rate {
    background: linear-gradient(135deg, var(--kr-silver) 0%, var(--kr-silver-dark) 100%);
}

.kr-metals-main {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.kr-gold-price-table {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--kr-shadow);
}

.kr-gold-price-table h2,
.kr-gold-price-table h3 {
    margin-top: 0;
    margin-bottom: 24px;
    color: #111827;
}

/* Canvas height fix for charts */
.kursrupiah-chart-container canvas {
    max-height: 400px !important;
    height: auto !important;
}

/* Make sure charts are visible */
.kr-chart-section {
    min-height: 400px;
    position: relative;
    margin-bottom: 60px;
}

.kr-chart-section canvas {
    display: block !important;
    width: 100% !important;
}

/* Loading state for charts */
.kr-loading::after {
    content: 'Loading chart...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #64748b;
    font-size: 14px;
}

@media (max-width: 768px) {
    .kr-metals-header h1 {
        font-size: 1.8rem;
    }

    .kr-metals-subtitle {
        font-size: 1rem;
    }

    .kr-gold-price-table {
        padding: 20px;
    }
}

/* Trend Indicators & Tooltip Update */
.kr-rate-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.kr-rate-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -1px;
    line-height: 1;
}

.kr-trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    white-space: nowrap;
    /* Enforce single line */
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    position: relative;
    cursor: help;
    transition: all 0.2s;
    outline: none;
}

.kr-trend-indicator:hover,
.kr-trend-indicator:focus-within {
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.kr-trend-arrow {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
}

.kr-trend-badge {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.01em;
}

.kr-dot {
    font-size: 1.1rem;
    line-height: 1;
    vertical-align: middle;
}

.kr-dot.green {
    color: #22c55e;
}

.kr-dot.red {
    color: #ef4444;
}

/* Green for Price Down (Rupiah Strengthening) */
.kr-trend-up .kr-trend-badge {
    color: #22c55e;
}

/* Red for Price Up (Rupiah Weakening) */
.kr-trend-down .kr-trend-badge {
    color: #ef4444;
}

.kr-trend-neutral .kr-trend-badge {
    color: #94a3b8;
}

.kr-info-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    z-index: 100;
}

.kr-info-icon {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.7;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.1);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: inherit;
    font-family: serif;
    font-style: italic;
    line-height: 1;
}

.kr-info-icon:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.kr-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    /* Vertical offset 12px from trigger */
    right: -10px;
    width: 280px;
    background: #1f2937;
    color: #f3f4f6;
    padding: 14px 16px;
    /* User requested: Top/Bottom 12-14px, Left/Right 14-16px */
    border-radius: 10px;
    /* User requested 8-10px */
    font-size: 0.875rem;
    line-height: 1.6;
    /* Ideal typography */
    font-weight: 500;
    /* Medium weight for clearer strokes */
    letter-spacing: 0.02em;
    /* Fix for cramped characters */
    text-align: left;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 9999;
    /* Anti-clipping high z-index */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: normal;
}

.kr-tooltip.is-active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.kr-tooltip-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.kr-tooltip-close:hover {
    color: #fff;
}

.kr-tooltip-header {
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.kr-tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Spacing between info items */
}

.kr-tooltip-body p {
    margin: 0;
    /* Remove default margins for gap control */
    display: flex;
    align-items: center;
    gap: 8px;
    /* Horizontal gap min 8px */
}

.kr-dot {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.kr-tooltip-body small {
    display: block;
    margin-top: 6px;
    color: #9ca3af;
    font-style: normal;
    font-size: 0.75rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 10px;
    line-height: 1.4;
}

@media (min-width: 1024px) {
    .kr-tooltip {
        bottom: auto;
        top: 50%;
        left: calc(100% + 12px);
        right: auto;
        transform: translateY(-50%) translateX(10px);
    }

    .kr-info-wrapper:hover .kr-tooltip,
    .kr-trend-indicator:hover+.kr-info-wrapper .kr-tooltip,
    .kr-tooltip.is-active {
        visibility: visible;
        opacity: 1;
        transform: translateY(-50%) translateX(0);
        pointer-events: auto;
    }

    .kr-tooltip::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 100%;
        bottom: auto;
        border-width: 8px;
        border-style: solid;
        border-color: transparent #1f2937 transparent transparent;
        transform: translateY(-50%);
    }
}

@media (max-width: 1023px) {
    .kr-tooltip {
        position: fixed;
        bottom: 20px;
        left: 15px;
        right: 15px;
        width: auto;
        max-width: none;
        transform: translateY(100px);
    }

    .kr-tooltip.is-active {
        transform: translateY(0);
    }

    .kr-tooltip::after {
        display: none;
    }
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .kr-rate-group {
        justify-content: center;
    }

    .kr-rate-value {
        font-size: 2rem;
    }

    .kr-tooltip {
        width: 200px;
    }
}

/* Layout Sections */
.kr-section {
    margin-bottom: 40px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.kr-section h2 {
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 700;
}

/* Quick Conversion */
.kr-quick-conversion-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.kr-quick-conversion-grid li {
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    color: #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kr-quick-conversion-grid li strong {
    color: #0f172a;
}