/**
 * ConvMaster - Volume Converter Styles
 * 
 * @package    ConvMaster
 * @version    1.0.0
 */

/* =====================================================
   TOOL PAGE LAYOUT
   ===================================================== */
.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tool-header__icon {
    font-size: 2.5rem;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    font-weight: 700;
    font-size: 2rem;
}

.tool-header__icon .icon--purple {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.tool-header__text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.tool-header__text p {
    margin: 0;
    color: var(--text-secondary);
}

/* =====================================================
   CURRENT DATE BANNER
   ===================================================== */
.current-date-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.current-date-banner__icon {
    font-size: 1.25rem;
}

.current-date-banner__text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* =====================================================
   CONVERTER WIDGET
   ===================================================== */
.volume-converter-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* =====================================================
   TOOLBAR
   ===================================================== */
.converter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    flex-wrap: wrap;
    gap: 1rem;
}

.converter-toolbar__left,
.converter-toolbar__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.converter-toolbar__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Region Selector */
.region-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.region-selector label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.region-selector select {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.region-selector select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* Popup Button */
.btn-popup {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-popup:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
}

.btn-popup__icon {
    font-size: 1rem;
}

/* =====================================================
   INPUT SECTION
   ===================================================== */
.converter-input-section {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem 1.5rem 0;
    flex-wrap: wrap;
}

.converter-input-row {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-width: 300px;
}

.converter-input-group {
    flex: 1;
}

.converter-input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.converter-input-group input,
.converter-input-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.converter-input-group input:focus,
.converter-input-group select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.converter-input-group input::placeholder {
    color: var(--text-tertiary);
}

/* Hide number input spinners */
.converter-input-group input[type="number"] {
    -moz-appearance: textfield;
}

.converter-input-group input[type="number"]::-webkit-outer-spin-button,
.converter-input-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Swap Button */
.btn-swap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: #8b5cf6;
}

.btn-swap:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
}

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

.btn-swap svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Reset Button */
.btn-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: #ef4444;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.btn-reset:active {
    transform: scale(0.95);
}

.btn-reset svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* =====================================================
   MESSAGE CONTAINER
   ===================================================== */
.converter-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    margin: 0 1.5rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.converter-message--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.converter-message--success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

/* =====================================================
   RESULTS SECTION
   ===================================================== */
.converter-results-section {
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
    color: #8b5cf6;
}

/* =====================================================
   RESULTS GROUPS
   ===================================================== */
.results-group {
    margin-bottom: 1.25rem;
}

.results-group__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.results-group__icon {
    font-size: 1.1rem;
}

.results-group__title--toggle {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.results-group__title--toggle:hover {
    color: #8b5cf6;
}

.results-group__arrow {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.results-group--collapsed .results-group__arrow {
    transform: rotate(-90deg);
}

.results-group--collapsed .results-grid {
    display: none;
}

/* =====================================================
   RESULTS GRID
   ===================================================== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.result-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    min-height: 80px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.05);
}

.result-card--active {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.result-card__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 0.375rem;
    text-align: center;
    line-height: 1.3;
}

.result-card__value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    text-align: center;
    word-break: break-all;
}

.result-card__copy {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    padding: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.result-card:hover .result-card__copy {
    opacity: 1;
}

.result-card__copy:hover {
    transform: scale(1.1);
}

/* =====================================================
   CONVERTER FOOTER
   ===================================================== */
.converter-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.privacy-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =====================================================
   SEO CONTENT
   ===================================================== */
.seo-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem;
}

.tool-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.feature-card__icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.step-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
}

.step-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    border-radius: 50%;
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Differences Alert */
.differences-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.differences-alert__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.differences-alert p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Reference Grid */
.reference-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.reference-card {
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.reference-card--us {
    border-left: 3px solid #3b82f6;
}

.reference-card--uk {
    border-left: 3px solid #ef4444;
}

.reference-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.reference-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reference-card li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.375rem 0;
    border-bottom: 1px dashed var(--border-color);
    font-family: 'SF Mono', 'Consolas', monospace;
}

.reference-card li:last-child {
    border-bottom: none;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    transition: background 0.2s ease;
}

.faq-item summary:hover {
    background: var(--bg-tertiary);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 1.25rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =====================================================
   POPUP WINDOW STYLES
   ===================================================== */
.popup-converter {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    min-width: 450px;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
}

.popup-converter__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    cursor: move;
    user-select: none;
}

.popup-converter__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.popup-converter__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.popup-converter__close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.popup-converter__body {
    padding: 1rem;
    max-height: calc(95vh - 60px);
    overflow-y: auto;
}

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

/* Popup specific styles */
.popup-converter .popup-input-section {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.popup-converter .popup-input-group {
    flex: 1;
    min-width: 120px;
}

.popup-converter .popup-input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.popup-converter .popup-input-group input,
.popup-converter .popup-input-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.popup-converter .popup-input-group input:focus,
.popup-converter .popup-input-group select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.popup-converter .popup-input-group input[type="number"] {
    -moz-appearance: textfield;
}

.popup-converter .popup-input-group input[type="number"]::-webkit-outer-spin-button,
.popup-converter .popup-input-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.popup-converter .popup-results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.popup-converter .popup-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.popup-converter .popup-result-item:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.05);
}

.popup-converter .popup-result-item--active {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.popup-converter .popup-result-item__label {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.popup-converter .popup-result-item__value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Consolas', monospace;
}

.popup-converter .popup-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.75rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.popup-converter .popup-section-title:first-child {
    margin-top: 0;
}

/* =====================================================
   HIDDEN STATE
   ===================================================== */
[hidden] {
    display: none !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reference-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .tool-page {
        padding: 1rem;
    }
    
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tool-header__text h1 {
        font-size: 1.5rem;
    }
    
    .converter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .converter-toolbar__left,
    .converter-toolbar__right {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .region-selector {
        flex: 1;
        min-width: 150px;
    }
    
    .converter-input-section {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1rem 0;
    }
    
    .converter-input-row {
        flex-direction: column;
        min-width: auto;
    }
    
    .btn-swap,
    .btn-reset {
        flex: 1;
        height: 44px;
    }
    
    .converter-input-section {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .converter-input-row {
        width: 100%;
    }
    
    .results-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-card__copy {
        opacity: 1;
    }
    
    .converter-results-section {
        padding: 0 1rem;
    }
    
    .features-grid,
    .steps-grid,
    .reference-grid {
        grid-template-columns: 1fr;
    }
    
    .popup-converter {
        min-width: auto;
        width: 95vw;
    }
    
    .popup-converter .popup-results {
        grid-template-columns: 1fr;
    }
    
    .btn-popup__text {
        display: none;
    }
}

@media (max-width: 480px) {
    .current-date-banner {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        text-align: center;
    }
    
    .current-date-banner__text {
        font-size: 0.95rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-card {
        padding: 0.75rem;
        min-height: 60px;
    }
    
    .result-card__value {
        font-size: 1rem;
    }
    
    .differences-alert {
        flex-direction: column;
        text-align: center;
    }
}

/* =====================================================
   DARK THEME SPECIFIC
   ===================================================== */
[data-theme="dark"] .result-card:hover {
    background: rgba(139, 92, 246, 0.08);
}

[data-theme="dark"] .result-card--active {
    background: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .feature-card:hover {
    background: rgba(139, 92, 246, 0.05);
}
