/**
 * ConvMaster - Ring 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--orange {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.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(249, 115, 22, 0.1), rgba(234, 179, 8, 0.1));
    border: 1px solid rgba(249, 115, 22, 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
   ===================================================== */
.ring-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);
}

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

.btn-popup:hover {
    background: rgba(249, 115, 22, 0.2);
    border-color: #f97316;
}

.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: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

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

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

/* Size Selector for UK letters */
.size-selector {
    width: 100%;
    padding: 0 1.5rem 1rem;
}

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

.size-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.size-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 40px;
    text-align: center;
}

.size-btn:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    color: #f97316;
}

.size-btn--active {
    background: #f97316;
    border-color: #f97316;
    color: white;
}

/* Stepper Buttons */
.converter-stepper {
    display: flex;
    gap: 0.5rem;
}

.btn-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: #f97316;
}

.btn-stepper:hover {
    background: rgba(249, 115, 22, 0.2);
    border-color: #f97316;
}

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

.btn-stepper svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2.5;
    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 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 Grid */
.results-grid {
    display: grid;
    gap: 0.75rem;
}

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

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

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

/* Result Card */
.result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 80px;
    position: relative;
}

.result-card:hover {
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.05);
}

.result-card--active {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.result-card--highlight {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), rgba(234, 179, 8, 0.05));
    border-color: rgba(249, 115, 22, 0.2);
}

.result-card__flag {
    width: 24px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-card__flag img {
    width: 24px;
    height: auto;
    border-radius: 2px;
}

.result-card__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.result-card__unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* =====================================================
   SIZE CHART SECTION
   ===================================================== */
.converter-chart-section {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

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

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

.btn-toggle-chart {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-chart:hover {
    background: rgba(249, 115, 22, 0.2);
}

.chart-container {
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.chart-container--expanded {
    max-height: none;
}

.chart-scroll {
    overflow-x: auto;
}

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

.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 th img {
    vertical-align: middle;
    margin-right: 4px;
}

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

.size-chart tr:hover td {
    background: rgba(249, 115, 22, 0.05);
}

.size-chart tr.size-chart__row--active td {
    background: rgba(249, 115, 22, 0.15);
    color: var(--text-primary);
    font-weight: 600;
}

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

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =====================================================
   MEASUREMENT GUIDE
   ===================================================== */
.measure-guide-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

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

.measure-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.measure-method {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.measure-method__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.measure-method h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem;
}

.measure-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.measure-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.measure-step__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f97316;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

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

/* Tips Section */
.tips-section {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), rgba(234, 179, 8, 0.05));
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: var(--radius-md);
}

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

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

.tips-list li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

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

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

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

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

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

/* 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(249, 115, 22, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

.feature-card h3 {
    font-size: 1rem;
    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: 1rem;
}

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

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

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

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

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

.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--4cols {
        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;
    }
    
    .converter-stepper {
        flex: 1;
    }
    
    .btn-stepper,
    .btn-reset {
        flex: 1;
        height: 44px;
    }
    
    .results-grid--2cols,
    .results-grid--3cols,
    .results-grid--4cols {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .converter-results-section {
        padding: 0 1rem;
    }
    
    .converter-chart-section {
        padding: 1rem;
    }
    
    .measure-methods {
        grid-template-columns: 1fr;
    }
    
    .features-grid,
    .steps-grid {
        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;
    }
    
    .result-card {
        padding: 0.75rem;
        min-height: 70px;
    }
    
    .result-card__value {
        font-size: 1.1rem;
    }
    
    .size-buttons {
        justify-content: center;
    }
}

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

[data-theme="dark"] .result-card--active {
    background: rgba(249, 115, 22, 0.15);
}

[data-theme="dark"] .size-chart tr:hover td {
    background: rgba(249, 115, 22, 0.08);
}

[data-theme="dark"] .measure-method {
    background: var(--bg-tertiary);
}
