/**
 * ConvMaster - Tire Size Calculator 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--amber {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.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(245, 158, 11, 0.1), rgba(234, 88, 12, 0.1));
    border: 1px solid rgba(245, 158, 11, 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);
}

/* =====================================================
   TIRE WIDGET
   ===================================================== */
.tire-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: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-popup:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

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

/* =====================================================
   TIRE INPUTS SECTION
   ===================================================== */
.tire-inputs-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.tire-input-group {
    flex: 1;
    min-width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.tire-input-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tire-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.tire-input-icon--original {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.tire-input-icon--new {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.tire-input-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tire-size-input {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
}

.tire-field {
    flex: 1;
    position: relative;
}

.tire-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tire-field input {
    width: 100%;
    padding: 0.75rem 0.5rem;
    padding-right: 1.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.tire-field input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

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

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

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

.tire-field-unit {
    position: absolute;
    right: 0.5rem;
    bottom: 0.85rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.tire-separator {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-tertiary);
    padding: 0 0.125rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.tire-preset-label {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
}

.tire-comparison-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-tertiary);
    padding-top: 2rem;
}

.tire-action {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-calculate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-calculate:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-calculate:active {
    transform: translateY(0);
}

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

.message-container--warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

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

/* Tire Visual Comparison */
.tire-visual-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.tire-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.tire-visual canvas {
    border-radius: var(--radius-md);
}

.tire-visual-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.tire-visual-size {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tire-visual-diff {
    display: flex;
    align-items: center;
    justify-content: center;
}

.diff-badge {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radius-md);
}

.diff-badge--positive {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.diff-badge--negative {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

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

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

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

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

.result-card__icon {
    font-size: 1.25rem;
}

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

.result-card__values {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.result-value {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.result-value--original {
    background: rgba(59, 130, 246, 0.1);
}

.result-value--new {
    background: rgba(34, 197, 94, 0.1);
}

.result-value__number {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-value__unit {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.result-card__diff {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

.result-card__diff--positive {
    color: #ef4444;
}

.result-card__diff--negative {
    color: #3b82f6;
}

.result-card__diff--neutral {
    color: #22c55e;
}

/* =====================================================
   SPEEDOMETER SECTION
   ===================================================== */
.speedometer-section {
    margin: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

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

.speedometer-content {
    padding: 1rem;
}

.speedometer-info {
    margin-bottom: 1rem;
}

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

.speedometer-table {
    overflow-x: auto;
}

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

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

.speedometer-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.speedometer-table td {
    color: var(--text-secondary);
}

.speedometer-table tbody tr:hover {
    background: var(--bg-secondary);
}

.speed-diff--positive {
    color: #ef4444;
    font-weight: 600;
}

.speed-diff--negative {
    color: #3b82f6;
    font-weight: 600;
}

.speed-diff--neutral {
    color: #22c55e;
    font-weight: 600;
}

/* =====================================================
   COMPATIBILITY SECTION
   ===================================================== */
.compatibility-section {
    margin: 0 1.5rem 1.5rem;
}

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

.compatibility-alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
}

.compatibility-alert--warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.compatibility-alert--danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.compatibility-alert--success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.compatibility-icon {
    font-size: 1.5rem;
}

.compatibility-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

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

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

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

.diagram-content {
    padding: 1.5rem;
}

.diagram-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.tire-diagram {
    max-width: 100%;
    width: 400px;
    height: auto;
}

/* Dark theme adjustment for SVG text */
[data-theme="dark"] .tire-diagram text {
    fill: currentColor;
}

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

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

.legend-color {
    width: 16px;
    height: 4px;
    border-radius: 2px;
}

.legend-color--width {
    background: #f59e0b;
}

.legend-color--profile {
    background: #3b82f6;
}

.legend-color--rim {
    background: #22c55e;
}

.legend-color--total {
    background: #ef4444;
}

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

.diagram-formula h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.formula-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    overflow-x: auto;
}

.formula-box code {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.85rem;
    color: #f59e0b;
    white-space: nowrap;
}

/* =====================================================
   COMMON SIZES SECTION
   ===================================================== */
.common-sizes-section {
    border-bottom: 1px solid var(--border-color);
}

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

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

.common-sizes-content {
    padding: 1.5rem;
}

.common-sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.common-size-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.common-size-category__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.common-size-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.common-size-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.common-size-item:hover {
    color: #f59e0b;
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

/* =====================================================
   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, #f59e0b, #d97706);
    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;
    }
    
    .tire-inputs-row {
        flex-direction: column;
    }
    
    .tire-input-group {
        min-width: 100%;
    }
    
    .tire-comparison-arrow {
        padding: 0.5rem 0;
        transform: rotate(90deg);
    }
    
    .tire-visual-comparison {
        flex-direction: column;
    }
    
    .tire-visual-diff {
        transform: rotate(90deg);
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .diagram-legend {
        grid-template-columns: 1fr;
    }
    
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .common-sizes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tire-size-input {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tire-field {
        flex: 0 0 30%;
        min-width: 70px;
    }
    
    .tire-separator {
        flex: 0 0 auto;
    }
    
    .result-card__values {
        flex-direction: column;
        gap: 0.5rem;
    }
}
