/**
 * SWVS Audio Tools — Shared Styles
 * Brand design system matching shapingwaves.com
 * Version: 1.0.0
 */

/* ============================================
   CSS Custom Properties (Brand Tokens)
   ============================================ */
:root {
    --swvs-brand: #FF0066;
    --swvs-brand-hover: #E6005C;
    --swvs-brand-active: #CC0052;
    --swvs-brand-light: rgba(255, 0, 102, 0.08);
    --swvs-brand-lighter: rgba(255, 0, 102, 0.04);

    --swvs-text: #0A0A0A;
    --swvs-text-muted: #666666;
    --swvs-text-light: #999999;
    --swvs-text-inverse: #FFFFFF;

    --swvs-bg: #FFFFFF;
    --swvs-bg-alt: #F7F7F7;
    --swvs-bg-input: #FAFAFA;
    --swvs-border: #E0E0E0;
    --swvs-border-focus: var(--swvs-brand);

    --swvs-success: #00CC66;
    --swvs-success-light: rgba(0, 204, 102, 0.1);
    --swvs-warning: #FF9900;
    --swvs-warning-light: rgba(255, 153, 0, 0.1);
    --swvs-error: #FF3333;
    --swvs-error-light: rgba(255, 51, 51, 0.1);
    --swvs-info: #3399FF;
    --swvs-info-light: rgba(51, 153, 255, 0.1);

    --swvs-font-heading: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --swvs-font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --swvs-font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

    --swvs-radius: 0px;
    --swvs-radius-sm: 2px;
    --swvs-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --swvs-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
    --swvs-shadow-focus: 0 0 0 3px rgba(255, 0, 102, 0.15);
    --swvs-transition: 0.2s ease;
}

/* ============================================
   Tools Hub — Overview Grid
   ============================================ */
.swvs-tools-hub {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.swvs-tools-hub__header {
    text-align: center;
    margin-bottom: 48px;
}

.swvs-tools-hub__title {
    font-family: var(--swvs-font-heading);
    font-size: 36px;
    font-weight: 700;
    color: var(--swvs-brand);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.swvs-tools-hub__subtitle {
    font-family: var(--swvs-font-body);
    font-size: 18px;
    color: var(--swvs-text-muted);
    margin: 0;
    line-height: 1.5;
}

.swvs-tools-hub__category {
    margin-bottom: 40px;
}

.swvs-tools-hub__category-title {
    font-family: var(--swvs-font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--swvs-text);
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--swvs-brand);
    display: flex;
    align-items: center;
    gap: 10px;
}

.swvs-tools-hub__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Tool Card */
.swvs-tool-card {
    background: var(--swvs-bg);
    border: 1px solid var(--swvs-border);
    border-radius: var(--swvs-radius);
    padding: 24px;
    text-decoration: none;
    color: var(--swvs-text);
    display: flex;
    flex-direction: column;
    transition: all var(--swvs-transition);
    box-shadow: var(--swvs-shadow);
}

.swvs-tool-card:hover {
    border-color: var(--swvs-brand);
    box-shadow: var(--swvs-shadow-hover);
    transform: translateY(-2px);
}

.swvs-tool-card:hover .swvs-tool-card__title {
    color: var(--swvs-brand);
}

.swvs-tool-card__icon {
    font-size: 32px;
    margin-bottom: 12px;
    line-height: 1;
}

.swvs-tool-card__title {
    font-family: var(--swvs-font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--swvs-text);
    margin: 0 0 8px 0;
    transition: color var(--swvs-transition);
}

.swvs-tool-card__description {
    font-family: var(--swvs-font-body);
    font-size: 14px;
    color: var(--swvs-text-muted);
    margin: 0;
    line-height: 1.5;
    flex-grow: 1;
}

.swvs-tool-card__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    margin-top: 12px;
    border-radius: var(--swvs-radius-sm);
    align-self: flex-start;
}

.swvs-tool-card__badge--coming-soon {
    background: var(--swvs-warning-light);
    color: var(--swvs-warning);
}

.swvs-tool-card__badge--new {
    background: var(--swvs-brand-light);
    color: var(--swvs-brand);
}

/* ============================================
   Individual Tool — Layout
   ============================================ */
.swvs-tool {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: var(--swvs-font-body);
    color: var(--swvs-text);
}

.swvs-tool__header {
    margin-bottom: 32px;
}

.swvs-tool__title {
    font-family: var(--swvs-font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--swvs-brand);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.swvs-tool__description {
    font-size: 16px;
    color: var(--swvs-text-muted);
    margin: 0;
    line-height: 1.5;
}

.swvs-tool__back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--swvs-text-muted);
    text-decoration: none;
    margin-bottom: 16px;
    transition: color var(--swvs-transition);
}

.swvs-tool__back-link:hover {
    color: var(--swvs-brand);
}

/* ============================================
   Form Controls
   ============================================ */
.swvs-form-group {
    margin-bottom: 20px;
}

.swvs-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.swvs-label {
    display: block;
    font-family: var(--swvs-font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--swvs-text);
    margin-bottom: 6px;
}

.swvs-label__hint {
    font-weight: 400;
    color: var(--swvs-text-light);
    font-size: 12px;
    margin-left: 4px;
}

.swvs-input,
.swvs-select {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--swvs-font-body);
    font-size: 16px;
    color: var(--swvs-text);
    background: var(--swvs-bg-input);
    border: 1px solid var(--swvs-border);
    border-radius: var(--swvs-radius);
    transition: all var(--swvs-transition);
    box-sizing: border-box;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
}

.swvs-input:focus,
.swvs-select:focus {
    outline: none;
    border-color: var(--swvs-brand);
    box-shadow: var(--swvs-shadow-focus);
    background: var(--swvs-bg);
}

.swvs-input::placeholder {
    color: var(--swvs-text-light);
}

.swvs-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* Input with unit suffix */
.swvs-input-group {
    display: flex;
    align-items: stretch;
}

.swvs-input-group .swvs-input {
    border-right: none;
    border-radius: var(--swvs-radius) 0 0 var(--swvs-radius);
    flex: 1;
}

.swvs-input-group__suffix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--swvs-text-muted);
    background: var(--swvs-bg-alt);
    border: 1px solid var(--swvs-border);
    border-radius: 0 var(--swvs-radius) var(--swvs-radius) 0;
    white-space: nowrap;
}

/* Range slider */
.swvs-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--swvs-border);
    border-radius: 3px;
    outline: none;
    margin: 8px 0;
}

.swvs-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--swvs-brand);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--swvs-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.swvs-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--swvs-brand);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--swvs-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Results Display
   ============================================ */
.swvs-results {
    background: var(--swvs-bg-alt);
    border: 1px solid var(--swvs-border);
    border-radius: var(--swvs-radius);
    padding: 24px;
    padding-top: 24px;
    margin-top: 32px;
}

.swvs-results__title {
    font-family: var(--swvs-font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--swvs-text);
    margin: 0 0 16px 0;
}

.swvs-result-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid var(--swvs-border);
}

.swvs-result-item:last-child {
    border-bottom: none;
}

.swvs-result-item__label {
    font-size: 14px;
    color: var(--swvs-text-muted);
}

.swvs-result-item__value {
    font-family: var(--swvs-font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--swvs-text);
}

.swvs-result-item__value--highlight {
    color: var(--swvs-brand);
    font-size: 20px;
}

/* Result grid for multiple outputs */
.swvs-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.swvs-result-card {
    background: var(--swvs-bg);
    border: 1px solid var(--swvs-border);
    border-radius: var(--swvs-radius);
    padding: 16px;
    text-align: center;
}

.swvs-result-card__value {
    font-family: var(--swvs-font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--swvs-brand);
    margin-bottom: 4px;
}

.swvs-result-card__label {
    font-size: 12px;
    color: var(--swvs-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Tables
   ============================================ */
.swvs-table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
}

.swvs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.swvs-table th {
    font-family: var(--swvs-font-heading);
    font-weight: 700;
    text-align: left;
    padding: 10px 12px;
    background: var(--swvs-bg-alt);
    border-bottom: 2px solid var(--swvs-brand);
    color: var(--swvs-text);
    white-space: nowrap;
}

.swvs-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--swvs-border);
    color: var(--swvs-text);
}

.swvs-table tr:hover td {
    background: var(--swvs-brand-lighter);
}

.swvs-table td.swvs-table__numeric {
    font-family: var(--swvs-font-mono);
    text-align: right;
}

.swvs-table th.swvs-table__numeric {
    text-align: right;
}

/* ============================================
   Buttons
   ============================================ */
.swvs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-family: var(--swvs-font-heading);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: var(--swvs-radius);
    cursor: pointer;
    transition: all var(--swvs-transition);
    text-decoration: none;
}

.swvs-btn--primary {
    background: var(--swvs-brand);
    color: var(--swvs-text-inverse);
}

.swvs-btn--primary:hover {
    background: var(--swvs-brand-hover);
}

.swvs-btn--secondary {
    background: transparent;
    color: var(--swvs-brand);
    border: 1px solid var(--swvs-brand);
}

.swvs-btn--secondary:hover {
    background: var(--swvs-brand-light);
}

.swvs-btn--small {
    padding: 6px 14px;
    font-size: 12px;
}

/* ============================================
   Utility Classes
   ============================================ */
.swvs-section {
    margin-bottom: 48px;
}

.swvs-section__title {
    font-family: var(--swvs-font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--swvs-text);
    margin: 0 0 16px 0;
}

.swvs-divider {
    border: none;
    border-top: 1px solid var(--swvs-border);
    margin: 32px 0;
}

.swvs-note {
    font-size: 13px;
    color: var(--swvs-text-muted);
    font-style: italic;
    margin-top: 8px;
}

.swvs-error {
    background: var(--swvs-error-light);
    color: var(--swvs-error);
    padding: 16px;
    border-radius: var(--swvs-radius);
    font-size: 14px;
}

.swvs-coming-soon {
    text-align: center;
    padding: 60px 20px;
    background: var(--swvs-bg-alt);
    border: 1px dashed var(--swvs-border);
    border-radius: var(--swvs-radius);
}

.swvs-coming-soon__icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.swvs-coming-soon h3 {
    font-family: var(--swvs-font-heading);
    color: var(--swvs-text);
    margin: 0 0 8px 0;
}

.swvs-coming-soon p {
    color: var(--swvs-text-muted);
    margin: 0;
}

/* Search/filter bar */
.swvs-search {
    position: relative;
    margin-bottom: 20px;
}

.swvs-search__input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    font-family: var(--swvs-font-body);
    font-size: 16px;
    color: var(--swvs-text);
    background: var(--swvs-bg-input);
    border: 1px solid var(--swvs-border);
    border-radius: var(--swvs-radius);
    box-sizing: border-box;
    transition: all var(--swvs-transition);
}

.swvs-search__input:focus {
    outline: none;
    border-color: var(--swvs-brand);
    box-shadow: var(--swvs-shadow-focus);
}

.swvs-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--swvs-text-light);
    font-size: 16px;
    pointer-events: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .swvs-tools-hub__title {
        font-size: 28px;
    }

    .swvs-tools-hub__grid {
        grid-template-columns: 1fr;
    }

    .swvs-tool__title {
        font-size: 26px;
    }

    .swvs-form-row {
        grid-template-columns: 1fr;
    }

    .swvs-results-grid {
        grid-template-columns: 1fr 1fr;
    }

    .swvs-result-card__value {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .swvs-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Library Search — Result Cards
   ============================================ */
.swvs-lib-result-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--swvs-border);
    transition: background var(--swvs-transition);
}

.swvs-lib-result-card:last-child {
    border-bottom: none;
}

.swvs-lib-result-card:hover {
    background: var(--swvs-brand-lighter);
}

.swvs-lib-result-card--featured {
    background: var(--swvs-brand-light);
    border-left: 3px solid var(--swvs-brand);
}

.swvs-lib-result-card--featured:hover {
    background: rgba(255, 0, 102, 0.12);
}

.swvs-lib-result-card__image {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    border-radius: var(--swvs-radius);
    overflow: hidden;
    background: var(--swvs-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.swvs-lib-result-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swvs-lib-result-card__image--placeholder {
    font-size: 24px;
    color: var(--swvs-text-light);
}

.swvs-lib-result-card__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.swvs-lib-result-card__title {
    font-family: var(--swvs-font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--swvs-text);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--swvs-transition);
}

a.swvs-lib-result-card__title:hover {
    color: var(--swvs-brand);
}

.swvs-lib-result-card__publisher {
    font-size: 14px;
    color: var(--swvs-text);
    margin-top: 2px;
    font-weight: 500;
}

.swvs-lib-result-card__meta {
    font-size: 12px;
    color: var(--swvs-text-light);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swvs-lib-result-card__action {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.swvs-lib-result-card__price {
    font-family: var(--swvs-font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--swvs-text);
}

@media (max-width: 768px) {
    .swvs-lib-result-card {
        flex-wrap: wrap;
    }

    .swvs-lib-result-card__image {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
    }

    .swvs-lib-result-card__action {
        flex: 0 0 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 8px;
        margin-top: 4px;
        border-top: 1px solid var(--swvs-border);
    }
}
