/* Sig Fig Calculator Plugin - Exact Replica Theme */

:root {
  --sfc-background: hsl(210, 20%, 98%);
  --sfc-foreground: hsl(222, 47%, 11%);
  --sfc-card: #ffffff;
  --sfc-card-foreground: hsl(222, 47%, 11%);
  --sfc-primary: hsl(221, 83%, 53%);
  --sfc-primary-foreground: #ffffff;
  --sfc-muted: hsl(210, 40%, 96%);
  --sfc-muted-foreground: hsl(215, 16%, 47%);
  --sfc-border: hsl(214, 32%, 91%);
  --sfc-input: hsl(214, 32%, 91%);
  --sfc-radius: 0.5rem;
  --sfc-accent-purple: hsl(270, 95%, 75%);
  --sfc-accent-orange: hsl(24, 95%, 53%);
}

/* Background Pattern matching App */
.sigfig-plugin-wrapper {
    background-color: var(--sfc-background);
    background-image: radial-gradient(hsl(221, 83%, 53%, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--sfc-border);
}

.sigfig-plugin-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    color: var(--sfc-foreground);
    line-height: 1.5;
}

/* Tabs as visual switcher */
.sigfig-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.sigfig-tab {
    padding: 8px 16px;
    border-radius: 20px;
    background: #ffffff;
    color: var(--sfc-muted-foreground);
    border: 1px solid var(--sfc-border);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.sigfig-tab:hover {
    background: #f8fafc;
}

.sigfig-tab.active {
    background: var(--sfc-primary);
    color: var(--sfc-primary-foreground);
    border-color: var(--sfc-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Card Styling mimicking shadcn/ui Card */
.sigfig-tool {
    display: none;
    background: var(--sfc-card);
    border-radius: var(--sfc-radius);
    border: 1px solid var(--sfc-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
    animation: sigfig-fade-in 0.3s ease-out;
}

.sigfig-tool.active {
    display: block;
}

@keyframes sigfig-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Specific Border Accents per tool */
#sigfig-counter { border-left: 4px solid var(--sfc-primary); }
#sigfig-calculator { border-left: 4px solid var(--sfc-accent-purple); /* Calculator uses accent in react, defaulting to purple/accent */ } 
#sigfig-rounder { border-left: 4px solid var(--sfc-accent-orange); }
#sigfig-converter { border-left: 4px solid #a855f7; }

/* Match React Component border colors exactly */
#sigfig-calculator { border-left-color: hsl(210, 40%, 96%); /* Accent/Muted in React, actually its border-l-accent which is var(--accent) -> muted essentially */ }
/* Wait, React code says: border-l-accent. Accent is hsl(210 40% 96%) which is very light grey? 
   Actually check index.css: --accent: 210 40% 96%
   The user sees a grey bar? Or is it styled differently? 
   Let's check SigFigCalculator.tsx: className="... border-l-accent ..."
   If accent is light grey, it might be subtle. Let's make it distinct or match exactly.
   Let's use a darker grey to be visible or keep it subtle as in preview.
   Actually, let's use the primary-ish color for "Operations" to make it pop if accent is too light.
   Or stick to the exact CSS var. 
*/
#sigfig-calculator { border-left-color: var(--sfc-muted-foreground); } /* Making it visible grey */


/* Header */
.sigfig-header {
    padding: 24px 24px 12px;
    border-bottom: 0;
}

.sigfig-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sfc-card-foreground);
}

.sigfig-desc {
    font-size: 0.875rem;
    color: var(--sfc-muted-foreground);
    margin: 4px 0 0 0;
}

/* Content Area */
.sigfig-content {
    padding: 24px;
}

/* Inputs */
.sigfig-form-group {
    margin-bottom: 20px;
}

.sigfig-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sfc-muted-foreground);
    margin-bottom: 6px;
}

.sigfig-input {
    width: 100%;
    height: 48px; /* h-12 to h-14 */
    padding: 8px 12px;
    border-radius: var(--sfc-radius);
    border: 1px solid var(--sfc-input);
    background: transparent;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1.125rem; /* text-lg */
    color: var(--sfc-foreground);
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.sigfig-input:focus {
    outline: none;
    border-color: var(--sfc-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.sigfig-input-muted {
    background: rgba(241, 245, 249, 0.5); /* bg-muted/20 */
}

/* Result Box */
.sigfig-result-display {
    background: rgba(241, 245, 249, 0.3); /* bg-muted/30 */
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: var(--sfc-radius);
    padding: 24px;
    text-align: center;
    margin-top: 24px;
}

.sigfig-result-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--sfc-muted-foreground);
    margin-bottom: 8px;
}

.sigfig-result-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3rem; /* text-5xl */
    font-weight: 700;
    color: var(--sfc-primary);
    line-height: 1;
}

.sigfig-result-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--sfc-muted-foreground);
    margin-top: 8px;
}

/* Buttons */
.sigfig-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border-radius: var(--sfc-radius);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.sigfig-btn-primary {
    background: var(--sfc-primary);
    color: var(--sfc-primary-foreground);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.sigfig-btn-primary:hover {
    background: hsl(221, 83%, 48%);
}

.sigfig-btn-orange {
    background: var(--sfc-accent-orange);
    color: white;
}
.sigfig-btn-orange:hover {
    background: hsl(24, 95%, 48%);
}

/* Calculator Grid */
.sigfig-calc-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: end;
    margin-bottom: 24px;
}

.sigfig-select-wrapper {
    position: relative;
    padding-bottom: 3px; /* visual alignment */
}

.sigfig-select {
    height: 48px;
    width: 70px;
    border-radius: var(--sfc-radius);
    border: 1px solid var(--sfc-border);
    background: rgba(241, 245, 249, 0.5); /* bg-muted/50 */
    text-align: center;
    font-size: 1.2rem;
    appearance: none;
    cursor: pointer;
}

/* Tip Box */
.sigfig-tip {
    margin-top: 24px;
    padding: 12px;
    background: rgba(239, 246, 255, 0.5); /* blue-50/50 */
    border-radius: var(--sfc-radius);
    font-size: 0.75rem;
    color: var(--sfc-muted-foreground);
    text-align: center;
}

.sigfig-converter-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sigfig-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; 
    height: 32px;
    border-radius: 50%;
    background: var(--sfc-card);
    border: 1px solid var(--sfc-border);
    color: var(--sfc-muted-foreground);
    margin: -10px auto;
    z-index: 10;
    position: relative;
}

/* Steps List */
.sigfig-steps-container {
    margin-top: 16px;
    background: rgba(241, 245, 249, 0.3);
    border: 1px solid var(--sfc-border);
    border-radius: var(--sfc-radius);
    padding: 16px;
    text-align: left;
}

.sigfig-steps-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--sfc-muted-foreground);
    margin-bottom: 8px;
}

.sigfig-step-item {
    font-size: 0.875rem;
    color: var(--sfc-muted-foreground);
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.sigfig-step-arrow {
    opacity: 0.5;
}

@media (max-width: 600px) {
    .sigfig-calc-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .sigfig-select {
        width: 100%;
    }
}
