/**
 * ConvMaster - Bandwidth Calculator Styles v1.0
 * 
 * @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);
}

.tool-header__icon .icon--cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.tool-header__icon .icon svg {
    width: 28px;
    height: 28px;
}

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

/* =====================================================
   FORMAT BADGES
   ===================================================== */
.format-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.format-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
}

.format-badge--mbps {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.format-badge--mbs {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.format-badge--gb {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.format-badge--time {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.format-badge--stream {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* =====================================================
   CURRENT DATE DISPLAY
   ===================================================== */
.current-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.current-date__icon {
    font-size: 1.1rem;
}

.current-date__text {
    font-weight: 500;
    color: var(--text-primary);
}

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

/* =====================================================
   TAB NAVIGATION
   ===================================================== */
.bandwidth-calculator__tabs {
    display: flex;
    flex-wrap: wrap;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
    gap: 0.25rem;
}

.bandwidth-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bandwidth-tab svg {
    flex-shrink: 0;
}

.bandwidth-tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.bandwidth-tab--active {
    background: var(--bg-card);
    color: #06b6d4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   TAB CONTENT
   ===================================================== */
.bandwidth-calculator__content {
    padding: 2rem 1.5rem;
}

.bandwidth-tab-content[hidden] {
    display: none !important;
}

.bandwidth-calculator__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.bandwidth-calculator__desc {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */
.bandwidth-form {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.bandwidth-form__group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bandwidth-form__group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bandwidth-form__input-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.bandwidth-input {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease;
    min-width: 0;
    -moz-appearance: textfield;
}

.bandwidth-input::-webkit-outer-spin-button,
.bandwidth-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bandwidth-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.bandwidth-input:focus {
    outline: none;
    border-color: #06b6d4;
}

.bandwidth-input--small {
    max-width: 100px;
}

.bandwidth-select {
    padding: 0.875rem 2rem 0.875rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    min-width: 100px;
}

.bandwidth-select:focus {
    outline: none;
    border-color: #06b6d4;
}

.bandwidth-unit {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.bandwidth-form__hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* =====================================================
   RESULT DISPLAY
   ===================================================== */
.bandwidth-result {
    background: rgba(6, 182, 212, 0.08);
    border: 2px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.bandwidth-result__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.bandwidth-result__value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #06b6d4;
    word-break: break-word;
}

.bandwidth-result__details,
.bandwidth-result__alternatives,
.bandwidth-result__breakdown,
.bandwidth-result__comparison {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.bandwidth-result__details code,
.bandwidth-result__alternatives code {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}

/* =====================================================
   STREAMING QUALITY GRID
   ===================================================== */
.streaming-quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.quality-option {
    cursor: pointer;
}

.quality-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.quality-option__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.quality-option input:checked + .quality-option__box {
    background: rgba(6, 182, 212, 0.1);
    border-color: #06b6d4;
}

.quality-option:hover .quality-option__box {
    border-color: #06b6d4;
}

.quality-option__label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.quality-option__bitrate {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* =====================================================
   MESSAGE AREA
   ===================================================== */
.bandwidth-calculator__message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border-top: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 500;
}

.bandwidth-calculator__message[hidden] {
    display: none !important;
}

.bandwidth-calculator__message--error {
    background: rgba(239, 68, 68, 0.1);
    border-top-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* =====================================================
   SPEEDS REFERENCE
   ===================================================== */
.speeds-reference {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.speeds-reference h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem;
    text-align: center;
}

.speeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.speed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.speed-card:hover {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.05);
}

.speed-card__icon {
    font-size: 1.5rem;
}

.speed-card__name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.speed-card__value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #06b6d4;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* =====================================================
   PRIVACY NOTICE
   ===================================================== */
.privacy-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-md);
    color: #22c55e;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

/* =====================================================
   SEO CONTENT
   ===================================================== */
.tool-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-bottom: 1rem;
}

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

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

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

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

/* Formats Table */
.formats-table-wrapper {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.formats-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.formats-table th,
.formats-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.formats-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.formats-table td {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.formats-table tr:last-child td {
    border-bottom: none;
}

.formats-table code {
    padding: 0.2rem 0.5rem;
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

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

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

.step-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #06b6d4;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    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;
}

/* Info Box */
.info-box {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.info-box--tip {
    border-left: 4px solid #06b6d4;
    background: rgba(6, 182, 212, 0.05);
}

.info-box--info {
    border-left: 4px solid #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.info-box__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-box__content strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.info-box__content p {
    margin: 0;
    font-size: 0.9rem;
}

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

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

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
}

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

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

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

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .bandwidth-calculator__tabs {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .bandwidth-calculator__tabs::-webkit-scrollbar {
        display: none;
    }
    
    .bandwidth-tab span {
        display: none;
    }
    
    .bandwidth-tab {
        padding: 0.75rem;
    }
    
    .bandwidth-result__value {
        font-size: 1.5rem;
    }
    
    .streaming-quality-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .format-badges {
        justify-content: center;
    }
    
    .bandwidth-form__input-row {
        flex-direction: column;
    }
    
    .bandwidth-select {
        width: 100%;
    }
    
    .bandwidth-input--small {
        max-width: 100%;
    }
    
    .speeds-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .streaming-quality-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .quality-option__box {
        padding: 0.75rem;
    }
    
    .formats-table th,
    .formats-table td {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .tool-page {
        padding: 1rem;
    }
    
    .bandwidth-calculator__content {
        padding: 1.5rem 1rem;
    }
    
    .bandwidth-result {
        padding: 1rem;
    }
    
    .bandwidth-result__value {
        font-size: 1.25rem;
    }
    
    .speeds-reference {
        padding: 1rem;
    }
}

/* =====================================================
   LIGHT THEME ADJUSTMENTS
   ===================================================== */
[data-theme="light"] .bandwidth-input,
[data-theme="light"] .bandwidth-select {
    background: white;
}

[data-theme="light"] .bandwidth-unit {
    background: white;
}

[data-theme="light"] .bandwidth-result {
    background: rgba(6, 182, 212, 0.05);
}

[data-theme="light"] .quality-option__box {
    background: white;
}

[data-theme="light"] .quality-option input:checked + .quality-option__box {
    background: rgba(6, 182, 212, 0.08);
}

[data-theme="light"] .speed-card {
    background: white;
}

[data-theme="light"] .speed-card:hover {
    background: rgba(6, 182, 212, 0.03);
}

[data-theme="light"] .formats-table {
    background: white;
}

[data-theme="light"] .info-box {
    background: white;
}

[data-theme="light"] .info-box--tip {
    background: rgba(6, 182, 212, 0.03);
}

[data-theme="light"] .info-box--info {
    background: rgba(59, 130, 246, 0.03);
}

[data-theme="light"] .current-date {
    background: white;
}
