/* =========================================================================
   UNIVERSAL DESIGN SYSTEM - COMPONENTS
   =========================================================================
   STRICT RULE: Only use variables. No hardcoded colors or spacing.
   Includes Buttons, Forms, Badges, and Tables.
   ========================================================================= */

/* -----------------------------------------
   TYPOGRAPHY
----------------------------------------- */
.tool-section-heading {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-black);
    letter-spacing: -0.02em;
    line-height: var(--line-height-tight);
}

.tool-section-subheading {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    line-height: var(--line-height-base);
}

/* -----------------------------------------
   BUTTON SYSTEM
----------------------------------------- */
.tool-btn-primary,
.tool-btn-secondary,
.tool-btn-outline,
.tool-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-family);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    line-height: var(--line-height-none);
    height: var(--btn-height-md);
    padding: 0 var(--btn-px-md);
}

.tool-btn-primary {
    background-color: var(--color-primary);
    color: var(--text-primary);
    border: 1px solid transparent;
}
.tool-btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.tool-btn-secondary {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}
.tool-btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-input);
}

.tool-btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}
.tool-btn-outline:hover:not(:disabled) {
    border-color: var(--color-primary);
    background-color: var(--bg-card);
}

.tool-btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}
.tool-btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background-color: var(--bg-card);
}

/* Button States */
button:disabled, .tool-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* -----------------------------------------
   FORMS & INPUTS
----------------------------------------- */
.tool-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.tool-input-field,
.tool-select-field,
.tool-textarea-field {
    width: 100%;
    height: var(--btn-height-lg);
    background-color: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0 var(--space-4);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.tool-textarea-field {
    height: auto;
    min-height: 120px;
    padding: var(--space-3) var(--space-4);
    resize: vertical;
}

.tool-input-field:focus,
.tool-select-field:focus,
.tool-textarea-field:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--border-focus);
}

.tool-input-field::placeholder,
.tool-textarea-field::placeholder {
    color: var(--text-muted);
}

/* -----------------------------------------
   BADGES
----------------------------------------- */
.tool-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: var(--line-height-none);
}

/* -----------------------------------------
   ICONS
----------------------------------------- */
.tool-icon { width: 24px; height: 24px; }
.tool-icon-sm { width: 20px; height: 20px; }
.tool-icon-xs { width: 16px; height: 16px; }

/* -----------------------------------------
   TABLES
----------------------------------------- */
.tool-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background-color: var(--bg-card);
}

.tool-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.tool-table th {
    background-color: var(--bg-card-hover);
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
    padding: var(--space-4);
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--border-light);
}

.tool-table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

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

.tool-table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

/* -----------------------------------------
   ACCESSIBILITY & FOCUS
----------------------------------------- */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
