/**
 * CalculateUSA - Custom Styles
 * shadcn/UI inspired aesthetic with Tailwind CSS
 */

/* ═══════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════ */
:root {
    --bg: #ffffff;
    --text: #0f172a;           /* slate-900 */
    --text-muted: #64748b;     /* slate-500 */
    --primary: #2563eb;        /* blue-600 */
    --primary-hover: #1d4ed8;  /* blue-700 */
    --primary-light: #eff6ff;  /* blue-50 */
    --border: #e2e8f0;         /* slate-200 */
    --border-focus: #3b82f6;   /* blue-500 */
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* ═══════════════════════════════════════════
   CARD COMPONENT
   ═══════════════════════════════════════════ */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ═══════════════════════════════════════════
   BUTTON COMPONENTS
   ═══════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ═══════════════════════════════════════════
   INPUT COMPONENTS
   ═══════════════════════════════════════════ */
.input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: var(--bg);
}

.input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.input:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group .input {
    padding-left: 2.75rem;
}

/* ═══════════════════════════════════════════
   SELECT COMPONENT
   ═══════════════════════════════════════════ */
.select {
    display: block;
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* ═══════════════════════════════════════════
   LABEL COMPONENT
   ═══════════════════════════════════════════ */
.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.label-muted {
    color: var(--text-muted);
    font-weight: 400;
}

/* ═══════════════════════════════════════════
   CALCULATOR RESULT CARD
   ═══════════════════════════════════════════ */
.result-card {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border-radius: var(--radius);
    padding: 1.5rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.result-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ═══════════════════════════════════════════
   RESULT TABLE
   ═══════════════════════════════════════════ */
.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-table th,
.result-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.result-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: #f8fafc;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.result-table tr:hover td {
    background: #f8fafc;
}

/* ═══════════════════════════════════════════
   FAQ ACCORDION
   ═══════════════════════════════════════════ */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-item + .faq-item {
    margin-top: 0.75rem;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
}

.faq-item summary:hover {
    background: #f8fafc;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item[open] summary {
    border-bottom: 1px solid var(--border);
}

.faq-item .faq-content {
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.faq-icon {
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-icon {
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════════
   STATE SELECTOR GRID
   ═══════════════════════════════════════════ */
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.state-link {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.15s ease;
}

.state-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ═══════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════ */
.hero-gradient {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%);
}

/* ═══════════════════════════════════════════
   CALCULATOR CARD
   ═══════════════════════════════════════════ */
.calculator-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.calculator-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.calculator-card .icon-wrapper {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════
   BADGE COMPONENT
   ═══════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: #dcfce7;
    color: #16a34a;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════
   RESPONSIVE UTILITIES
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .state-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════ */
@media print {
    header, footer, .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}
