/**
 * ConvMaster - Bra Size 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--pink {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.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(236, 72, 153, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(236, 72, 153, 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
   ===================================================== */
.bra-converter-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* =====================================================
   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);
}

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

.btn-popup:hover {
    background: rgba(236, 72, 153, 0.2);
    border-color: #ec4899;
}

.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: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 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;
}

/* 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(236, 72, 153, 0.1);
    border-color: #ec4899;
    color: #ec4899;
}

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

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

.result-card:hover {
    border-color: rgba(236, 72, 153, 0.4);
    background: rgba(236, 72, 153, 0.05);
}

.result-card--active {
    border-color: #ec4899;
    background: rgba(236, 72, 153, 0.1);
}

.result-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.result-card__flag {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    object-fit: cover;
}

.result-card__label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.result-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

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

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

/* =====================================================
   MEASUREMENT INFO
   ===================================================== */
.measurement-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.measurement-info__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.measurement-info__label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.measurement-info__value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* =====================================================
   SISTER SIZES SECTION
   ===================================================== */
.sister-sizes-section {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

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

.section-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.sister-sizes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.sister-size-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.sister-size-card--smaller {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sister-size-card--current {
    background: rgba(236, 72, 153, 0.1);
    border: 2px solid #ec4899;
}

.sister-size-card--larger {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sister-size-card__label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.sister-size-card__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* =====================================================
   CHART SECTION
   ===================================================== */
.chart-section {
    padding: 0 1.5rem 1.5rem;
}

.chart-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    font-size: 0.9rem;
    font-weight: 600;
    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;
}

.chart-toggle:hover {
    background: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.3);
    color: #ec4899;
}

.chart-toggle__arrow {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.chart-toggle--open .chart-toggle__arrow {
    transform: rotate(180deg);
}

.chart-container {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chart-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.chart-tab {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-tab:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.chart-tab:hover {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.chart-tab--active {
    background: var(--bg-card);
    color: #ec4899;
    font-weight: 600;
}

.chart-content {
    max-height: 400px;
    overflow-y: auto;
}

.size-chart {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.size-chart th,
.size-chart td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.size-chart th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
}

.size-chart td {
    color: var(--text-secondary);
}

.size-chart tbody tr:hover {
    background: rgba(236, 72, 153, 0.05);
}

.size-chart tbody tr:last-child td {
    border-bottom: none;
}

/* =====================================================
   PRIVACY NOTICE
   ===================================================== */
.privacy-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

/* =====================================================
   TIPS GRID
   ===================================================== */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.tip-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.tip-card__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

/* =====================================================
   TOOL SECTION (SEO)
   ===================================================== */
.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 {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* =====================================================
   FEATURES GRID
   ===================================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

.feature-card:hover {
    border-color: rgba(236, 72, 153, 0.3);
    transform: translateY(-2px);
}

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

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

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

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

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

.step-card {
    position: relative;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

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

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

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

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

.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;
}

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

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-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;
    }
    
    .converter-input-section {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1rem 0;
    }
    
    .converter-input-row {
        flex-direction: column;
        min-width: auto;
    }
    
    .btn-reset {
        flex: 1;
        height: 44px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .converter-results-section {
        padding: 0 1rem;
    }
    
    .result-card__copy {
        opacity: 1;
    }
    
    .sister-sizes-section {
        padding: 1rem;
    }
    
    .chart-section {
        padding: 0 1rem 1rem;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid,
    .steps-grid,
    .steps-grid--2cols {
        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);
    }
    
    .sister-sizes-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .measurement-info {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .result-card__value {
        font-size: 1.25rem;
    }
}

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

[data-theme="dark"] .result-card--active {
    background: rgba(236, 72, 153, 0.15);
}

[data-theme="dark"] .size-chart tbody tr:hover {
    background: rgba(236, 72, 153, 0.08);
}

/* =====================================================
   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: 400px;
    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: 100px;
}

.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 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 select:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}

.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(236, 72, 153, 0.3);
    background: rgba(236, 72, 153, 0.05);
}

.popup-converter .popup-result-item--active {
    border-color: #ec4899;
    background: rgba(236, 72, 153, 0.1);
}

.popup-converter .popup-result-item__flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    margin-right: 0.375rem;
}

.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: 'JetBrains Mono', monospace;
}
