/* =========================================================
   FAMILY CALCULATORS - PREMIUM MAIN STYLESHEET
   Clean, modern, and high-performance financial-tech stylesheet.
========================================================= */

/* Typography & Root settings */
.fc-calculator {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e293b;
    width: 100%;
    max-width: 620px;
    margin: 15px auto;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-sizing: border-box;
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    text-align: left;
}

/* Header typography styles */
.fc-calc-header {
    margin-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
}

.fc-calculator h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
    letter-spacing: -0.02em;
}

.fc-calculator p {
    font-size: 14px;
    margin: 0 !important;
    line-height: 1.5 !important;
    color: #64748b !important;
}

/* Inputs Structure & Form Elements */
.fc-inputs {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.fc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.fc-field-error .fc-input {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.fc-field label {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    margin: 0 !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    line-height: 1.4;
}

/* Base custom input styles */
.fc-input {
    width: 100%;
    padding: 11px 13px;
    box-sizing: border-box;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    background-color: #f8fafc;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    -webkit-appearance: none;
}

.fc-input[type="number"] {
    -moz-appearance: textfield;
}
.fc-input[type="number"]::-webkit-outer-spin-button,
.fc-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fc-input:hover {
    border-color: #94a3b8;
}

.fc-input:focus {
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Textarea spec style */
textarea.fc-input {
    min-height: 80px;
    resize: vertical;
}

/* Radios and Checkboxes aesthetics */
.fc-radio-option, .fc-checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-top: 4px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
}

.fc-radio-option:hover, .fc-checkbox-option:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.fc-radio-option input[type="radio"], .fc-checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    flex-shrink: 0;
}

.fc-radio-text, .fc-checkbox-text {
    font-weight: 500;
    color: #475569;
}

/* Calculation primary Action Button */
.fc-button {
    background: #2563eb !important;
    color: #ffffff !important;
    padding: 13px 20px !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    width: 100% !important;
    margin-top: 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    transition: background 0.18s ease, transform 0.12s ease !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.16) !important;
    text-transform: none !important;
}

.fc-button:hover {
    background: #1d4ed8 !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25) !important;
}

.fc-button:active {
    transform: scale(0.995) !important;
}

/* RESULTS PANEL SYSTEM */
.fc-result-box {
    margin-top: 24px;
    padding: 20px;
    background: #fdfdfd;
    border: 1.5px solid #2563eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.04);
    animation: fcFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fc-result {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.45;
    color: #1e3a8a;
    border-bottom: 1.5px solid #e0e7ff;
    padding-bottom: 14px;
    margin-bottom: 16px;
}

/* AI PROMPTS LIST ELEMENT */
.fc-prompts {
    padding-top: 4px;
}

.fc-prompts-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.01eM;
}

.fc-prompt-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
    transition: hover 0.2s ease;
}

.fc-prompt-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.fc-prompt-title {
    font-weight: 700;
    font-size: 13.5px;
    color: #334155;
    margin-bottom: 6px;
    line-height: 1.3;
}

.fc-prompt-preview {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    word-break: break-word;
}

.fc-prompt-full {
    font-size: 13px;
    color: #334155;
    line-height: 1.55;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 8px 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.fc-prompt-toggle {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    display: inline-block;
    transition: color 0.15s ease;
}

.fc-prompt-toggle:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Prompt actions layout */
.fc-prompt-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

/* Links Action Triggers */
.fc-copy-link, .fc-use-ai, .fc-copy-text {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    transition: all 0.15s ease;
    user-select: none;
}

.fc-copy-link:hover, .fc-copy-text:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.fc-use-ai.fc-chatgpt {
    color: #ffffff;
    background: #10a37f;
    border-color: #0e8568;
}

.fc-use-ai.fc-chatgpt:hover {
    background: #0d8a6b;
}

.fc-use-ai.fc-gemini {
    color: #ffffff;
    background: #1a73e8;
    border-color: #1557b0;
}

.fc-use-ai.fc-gemini:hover {
    background: #1669d6;
}

/* EMBED CODES AREA */
.fc-embed-box {
    margin-top: 24px;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
    font-size: 13.5px;
}

.fc-embed-box summary {
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    padding: 2px;
    outline: none;
    user-select: none;
}

.fc-embed-box summary:hover {
    color: #1e293b;
}

.fc-embed-content {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fc-embed-code {
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 12px;
    color: #475569;
    resize: none;
}

.fc-copy-text {
    align-self: flex-start;
}

/* BRANDING & CREDIT LINKS */
.fc-branding {
    text-align: center;
    margin-top: 24px;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
    font-size: 12.5px;
    color: #94a3b8;
}

.fc-branding a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.fc-branding a:hover {
    text-decoration: underline;
}

/* GENERAL UTILITY STATES */
.fc-hidden {
    display: none !important;
}

/* INFO CLICABLE TOOLTIP NODE */
.fc-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 6px;
    border-radius: 50%;
    background: #ffffff;
    color: #64748b;
    border: 1.5px solid #64748b;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    user-select: none;
    vertical-align: middle;
    transition: all 0.15s ease;
}

.fc-info:hover {
    color: #2563eb;
    border-color: #2563eb;
    background: #eff6ff;
}

/* ABSOLUTE FLOATING TOOLTIP POPUP */
.fc-tooltip {
    position: absolute;
    background: #0f172a;
    color: #f8fafc;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    line-height: 1.45;
    max-width: 200px;
    z-index: 100000;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.15);
    word-wrap: break-word;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
}

/* RESPONSIVE LAYOUTS & TOUCH FRIENDLY CHUNKS */
@media (max-width: 640px) {
    .fc-calculator {
        padding: 18px;
        margin: 10px;
        border-radius: 8px;
    }

    .fc-calculator h2 {
        font-size: 18px;
    }

    .fc-result {
        font-size: 17px;
    }

    .fc-button {
        padding: 14px 18px !important;
        font-size: 15px !important;
    }

    .fc-radio-option, .fc-checkbox-option {
        padding: 12px 14px; /* expand touch target for mobile */
    }

    .fc-prompt-actions {
        flex-direction: column;
        gap: 8px;
    }

    .fc-copy-link, .fc-use-ai, .fc-copy-text {
        width: 100%;
        box-sizing: border-box;
    }
}
