/**
 * Gov Capital Converter Page Styles
 */

/* Panel body - ensure proper containment */
.panel-body {
    position: relative;
    overflow: visible;
}

/* Page header title styling */
.page-header__title h1 {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    margin: 0 0 15px 0;
}

/* Main converter wrapper */
.converter-page {
    max-width: 1230px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Converter form styling */
.gc-converter-wrapper {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin: 30px 0;
}

.gc-converter-fields {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gc-converter-fields > div {
    flex: 1;
    min-width: 200px;
}

.gc-converter-fields label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.gc-converter-fields input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.gc-converter-fields input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

.gc-converter-fields input[type="submit"] {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 25px;
}

.gc-converter-fields input[type="submit"]:hover {
    background: #005177;
}

/* History section */
.converter-history {
    background: #f5f5f5;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 25px;
    margin-top: 40px;
}

.converter-history h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.converter-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.converter-history-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.converter-history-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.converter-history-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.converter-history-item:hover a {
    color: #0073aa;
}

.converter-history-conversion {
    font-weight: 500;
}

.converter-history-time {
    font-size: 12px;
    color: #999;
}

/* Info section */
.converter-info {
    margin-top: 40px;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.converter-info h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

.converter-info p {
    color: #666;
    line-height: 1.6;
    margin: 10px 0;
}

/* jQuery UI Autocomplete - custom styling for converter */
.ui-autocomplete {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
}

.ui-menu-item {
    list-style: none;
}

.ui-menu-item-wrapper {
    display: block;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    text-decoration: none;
}

.ui-menu-item:last-child .ui-menu-item-wrapper {
    border-bottom: none;
}

/* Hover state with blue background and white text */
.ui-menu-item .ui-menu-item-wrapper:hover,
.ui-menu-item .ui-menu-item-wrapper.ui-state-hover,
.ui-menu-item .ui-menu-item-wrapper.ui-state-focus,
.ui-menu-item .ui-menu-item-wrapper.ui-state-active {
    background: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
}

/* Ensure text stays white on hover */
.ui-menu-item .ui-menu-item-wrapper:hover *,
.ui-menu-item .ui-menu-item-wrapper.ui-state-hover *,
.ui-menu-item .ui-menu-item-wrapper.ui-state-focus *,
.ui-menu-item .ui-menu-item-wrapper.ui-state-active * {
    color: #fff !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .converter-page {
        padding: 10px;
    }
    
    .gc-converter-wrapper {
        padding: 20px;
    }
    
    .gc-converter-fields {
        flex-direction: column;
    }
    
    .gc-converter-fields > div {
        width: 100%;
        min-width: unset;
    }
    
    .gc-converter-fields input[type="submit"] {
        width: 100%;
        margin-top: 15px;
    }
    
    .converter-history-item a {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Make h1 much bigger on mobile - matching forecast-chart-subtitle size */
    .panel-body .page-header__title h1 {
        font-size: 2rem !important;
        line-height: 1.4 !important;
        font-weight: 600 !important;
    }
    
    /* Scale other headings proportionally for good hierarchy */
    .converter-result h2 {
        font-size: 1.5rem !important;
    }
    
    .converter-info h2,
    .gc-crypto-forecast-table h3,
    .sidebar-widget h3 {
        font-size: 1.25rem !important;
    }
    
    .suggestion-graph-box h4 {
        font-size: 1rem !important;
    }
}

/* No history message */
.converter-no-history {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* Converter result styling */
.gc-converter-error {
    color: #d63638;
    font-weight: 500;
}

.converter-result {
    background: #f5f5f5;
    padding: 25px;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    text-align: center;
}

.converter-result h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.converter-result p {
    color: #666;
    font-size: 16px;
    margin: 5px 0;
}

/* Forecast table within converter - inherit from market-overview styles */
.gc-crypto-forecast-table {
    margin: 30px 0;
}

.gc-crypto-forecast-table h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
}

/* Converter charts section */
.converter-charts-wrapper {
    margin: 40px 0;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.converter-charts-wrapper .row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.converter-charts-wrapper .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 15px;
}

/* Forecast chart titles */
.forecast-chart-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: #333;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.forecast-chart-subtitle strong {
    font-weight: 600;
}

/* Responsive chart containers */
@media (max-width: 768px) {
    .converter-charts-wrapper .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .forecast-chart-subtitle {
        font-size: 16px;
    }
}

/* Converter page detailed tables - now using market-overview.css styles */

/* Other currencies and amounts links */
.other-amount-link {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    background: #f5f5f5;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.other-amount-link:hover {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    text-decoration: none;
}

/* Suggestion graphs */
.suggestion-graphs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.suggestion-graph {
    flex: 1 1 23%;
    border: 1px solid #ccc;
    padding: 5px;
    background: #fff;
    border-radius: 4px;
}

.suggestion-graph h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

/* Converter-specific page header additions */
.page-header__subtitle a {
    color: #0073aa;
    text-decoration: none;
}

.page-header__subtitle a:hover {
    text-decoration: underline;
}

/* Remove secondary menu styling - using existing theme styles */

/* Converter info styling */
.converter-result h2,
.converter-result h3,
.converter-result h4 {
    color: #333;
    margin: 25px 0 15px 0;
}

.converter-result h2 {
    font-size: 24px;
    font-weight: 600;
}

.converter-result h3 {
    font-size: 20px;
    font-weight: 600;
}

.converter-result h4 {
    font-size: 18px;
    font-weight: 600;
}


/* Chart cell in table */
.chart-cell {
    text-align: center;
    vertical-align: middle;
}

/* Converter result table styling - now using market-overview.css styles */
/* Keep only the specific styling for change values and colors */

/* Specific styling for change values table */
.market-table-wrapper table td:nth-child(3),
.market-table-wrapper table td:nth-child(4) {
    text-align: right;
}

/* Green/red color for changes - using same colors as market-overview.css */
.converter-result span[style*="color:green"] {
    color: #0da059 !important;
    font-weight: 500;
}

.converter-result span[style*="color:red"] {
    color: #ea3323 !important;
    font-weight: 500;
}

/* Conversation table specific styling */
.market-table-wrapper table td:nth-child(2) {
    text-align: center;
    font-weight: 600;
    color: #666;
}

/* Converter layout with sidebar */
.converter-layout {
    display: flex;
    gap: 30px;
    margin: 30px 0;
    position: relative;
    overflow: visible;
    align-items: flex-start;
}


.converter-main {
    flex: 1;
    min-width: 0;
}

.converter-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* Sidebar widget styling */
.sidebar-widget {
    background: #f5f5f5;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar-widget h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

/* Reverse calculation button */
.reverse-calc-btn {
    display: inline-block;
    margin: 10px 0;
}

/* Suggestion graphs wrapper */
.suggestion-graphs-wrapper {
    clear: both;
    width: 100%;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

/* Suggestion graphs styling */
.suggestion-graphs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.suggestion-graph-box {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.suggestion-graph-box:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.suggestion-graph-box h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-mini-chart {
    width: 100%;
    height: 80px;
    margin: 15px 0;
}

.suggestion-value {
    text-align: center;
    padding: 15px 0 0 0;
}

.suggestion-value .currency-code {
    font-size: 24px;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 5px;
}

.suggestion-value .currency-name {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.suggestion-value .converted-amount {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .converter-layout {
        flex-direction: column;
    }
    
    .converter-sidebar {
        width: 100%;
    }
    
    .suggestion-graphs {
        grid-template-columns: 1fr;
    }
}

/* Maintain readable sizes for very small screens */
@media (max-width: 480px) {
    .panel-body .page-header__title h1 {
        font-size: 1.75rem !important;
        line-height: 1.4 !important;
        word-break: break-word;
    }
    
    .converter-result h2 {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
    }
    
    .converter-info h2,
    .gc-crypto-forecast-table h3,
    .sidebar-widget h3 {
        font-size: 1.125rem !important;
    }
    
    .suggestion-graph-box h4 {
        font-size: 0.9rem !important;
        min-height: 36px;
    }
}