/**
 * ConvMaster - T-Shirt 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--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(124, 58, 237, 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);
}

/* =====================================================
   TSHIRT WIDGET
   ===================================================== */
.tshirt-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* =====================================================
   TOOLBAR
   ===================================================== */
.widget-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;
}

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

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

/* Toolbar Buttons */
.btn-toolbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toolbar:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-color: var(--text-tertiary);
}

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

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

/* =====================================================
   GENDER SECTION
   ===================================================== */
.gender-section {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.gender-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.gender-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    justify-content: center;
}

.gender-tab:hover {
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

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

.gender-tab__icon {
    font-size: 1.25rem;
}

/* =====================================================
   CONVERSION SECTION
   ===================================================== */
.conversion-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.conversion-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.conversion-group {
    min-width: 200px;
}

.conversion-group--sizes {
    flex: 1;
}

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

.conversion-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    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;
    cursor: pointer;
}

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

/* Size Buttons */
.size-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.size-btn {
    min-width: 56px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

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

.size-btn.active {
    color: white;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

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

.message-container[hidden] {
    display: none;
}

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

.message-container--success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* =====================================================
   RESULTS SECTION
   ===================================================== */
.results-section {
    border-bottom: 1px solid var(--border-color);
}

.results-section[hidden] {
    display: none;
}

.results-header {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

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

.results-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

.result-card {
    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);
    text-align: center;
    transition: all 0.2s ease;
}

.result-card:hover {
    border-color: var(--text-tertiary);
}

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

.result-card__flag {
    font-size: 1.5rem;
    margin-bottom: 0.375rem;
}

.result-card__system {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.result-card__size {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.result-card--highlight .result-card__size {
    color: #8b5cf6;
}

/* =====================================================
   CHART SECTION
   ===================================================== */
.chart-section {
    border-bottom: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

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

/* Unit Toggle */
.unit-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.unit-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-btn:hover {
    color: var(--text-primary);
}

.unit-btn.active {
    color: white;
    background: #8b5cf6;
}

.chart-container {
    padding: 1rem 1.5rem;
    overflow-x: 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);
    white-space: nowrap;
}

.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 td {
    background: var(--bg-secondary);
}

.size-chart tbody tr.highlight td {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
    font-weight: 600;
}

.chart-note {
    padding: 0 1.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin: 0;
}

/* =====================================================
   GUIDE SECTION
   ===================================================== */
.guide-section {
    border-bottom: 1px solid var(--border-color);
}

.guide-header {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

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

.guide-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 1.5rem;
}

/* T-Shirt Diagram Visual */
.guide-visual {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tshirt-diagram {
    width: 100%;
    max-width: 280px;
    height: auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.tshirt-shape {
    fill: var(--bg-card);
    stroke: var(--border-color);
    stroke-width: 2;
}

.tshirt-collar {
    fill: var(--bg-secondary);
    stroke: var(--border-color);
    stroke-width: 1.5;
}

.tshirt-stitch {
    stroke: var(--text-tertiary);
    stroke-width: 1;
    fill: none;
}

/* Measurement lines */
.measure-group .measure-line {
    stroke-width: 2;
    stroke-dasharray: 6, 3;
    fill: none;
}

.measure-group .measure-cap {
    stroke-width: 2;
    fill: none;
}

.measure-group .measure-dot {
    stroke-width: 2;
    fill: var(--bg-card);
}

.measure-group .measure-arrow {
    stroke: none;
}

.measure-group .measure-label-bg {
    fill: var(--bg-card);
    stroke-width: 1;
}

.measure-group .measure-label {
    font-size: 11px;
    font-weight: 600;
    text-anchor: middle;
    fill: var(--text-primary);
}

/* Chest - Purple */
.measure-group--chest .measure-line,
.measure-group--chest .measure-cap,
.measure-group--chest .measure-dot {
    stroke: #8b5cf6;
}

.measure-group--chest .measure-dot {
    fill: rgba(139, 92, 246, 0.2);
}

.measure-group--chest .measure-arrow {
    fill: #8b5cf6;
}

.measure-group--chest .measure-label-bg {
    fill: rgba(139, 92, 246, 0.15);
    stroke: #8b5cf6;
}

.measure-group--chest .measure-label {
    fill: #8b5cf6;
}

/* Length - Cyan */
.measure-group--length .measure-line,
.measure-group--length .measure-cap,
.measure-group--length .measure-dot {
    stroke: #06b6d4;
}

.measure-group--length .measure-dot {
    fill: rgba(6, 182, 212, 0.2);
}

.measure-group--length .measure-label-bg {
    fill: rgba(6, 182, 212, 0.15);
    stroke: #06b6d4;
}

.measure-group--length .measure-label {
    fill: #06b6d4;
}

/* Shoulder - Orange */
.measure-group--shoulder .measure-line,
.measure-group--shoulder .measure-cap,
.measure-group--shoulder .measure-dot {
    stroke: #f59e0b;
}

.measure-group--shoulder .measure-dot {
    fill: rgba(245, 158, 11, 0.2);
}

.measure-group--shoulder .measure-label-bg {
    fill: rgba(245, 158, 11, 0.15);
    stroke: #f59e0b;
}

.measure-group--shoulder .measure-label {
    fill: #f59e0b;
}

/* Legend */
.guide-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.legend-color {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-item--chest .legend-color {
    background: #8b5cf6;
}

.legend-item--shoulder .legend-color {
    background: #f59e0b;
}

.legend-item--length .legend-color {
    background: #06b6d4;
}

/* Steps */
.guide-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.guide-step {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.guide-step__number {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.guide-step__content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}

.guide-step__content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Tips Box */
.tips-box {
    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: 0 1.5rem 1.5rem;
}

.tips-box h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f59e0b;
    margin: 0 0 0.75rem;
}

.tips-box ul {
    margin: 0;
    padding-left: 1.25rem;
}

.tips-box li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.tips-box li:last-child {
    margin-bottom: 0;
}

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

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

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

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

.seo-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(auto-fit, minmax(280px, 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: var(--text-tertiary);
}

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

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

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

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

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

.step-card__number {
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.step-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.375rem;
}

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

/* 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-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    color: var(--text-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-icon {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

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

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .tool-page {
        padding: 1rem 0.75rem;
    }
    
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tool-header__text h1 {
        font-size: 1.5rem;
    }
    
    .widget-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .widget-toolbar__left,
    .widget-toolbar__right {
        justify-content: center;
    }
    
    .gender-tabs {
        flex-direction: column;
    }
    
    .gender-tab {
        min-width: 100%;
    }
    
    .conversion-row {
        flex-direction: column;
    }
    
    .conversion-group {
        min-width: 100%;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .guide-content {
        grid-template-columns: 1fr;
    }

    .guide-visual {
        order: -1;
    }

    .tshirt-diagram {
        max-width: 220px;
        margin: 0 auto;
    }
    
    .guide-steps {
        grid-template-columns: 1fr;
    }
    
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .results-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .result-card {
        padding: 0.75rem;
    }
    
    .result-card__size {
        font-size: 1.5rem;
    }
    
    .size-buttons {
        justify-content: center;
    }
    
    .size-btn {
        min-width: 48px;
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }
}
