/**
 * FSBO Net Sheet Estimator - Styles
 * Version: 1.0.0
 */

/* ========================================
   Variables & Reset
   ======================================== */
:root {
    --primary-color: #2C5F8D;
    --secondary-color: #4A90A4;
    --accent-color: #F39C12;
    --success-color: #27AE60;
    --error-color: #E74C3C;
    --background-color: #F8F9FA;
    --card-background: #FFFFFF;
    --text-color: #2C3E50;
    --text-light: #7F8C8D;
    --border-color: #DEE2E6;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* ========================================
   Main Container
   ======================================== */
.fsbo-netsheet-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fsbo-netsheet-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========================================
   Header
   ======================================== */
.fsbo-netsheet-header {
    text-align: center;
    margin-bottom: 30px;
}

.fsbo-netsheet-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.fsbo-netsheet-subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin: 0;
}

/* ========================================
   Disclaimer
   ======================================== */
.fsbo-netsheet-disclaimer {
    background: #FFF3CD;
    border: 1px solid #FFE69C;
    border-left: 4px solid var(--accent-color);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    font-size: 14px;
    line-height: 1.6;
}

.fsbo-netsheet-disclaimer strong {
    color: var(--accent-color);
}

/* ========================================
   Content Layout
   ======================================== */
.fsbo-netsheet-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

/* ========================================
   Form Sections
   ======================================== */
.fsbo-netsheet-section {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.fsbo-netsheet-section:hover {
    box-shadow: var(--shadow-md);
}

.fsbo-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--background-color);
}

.section-icon {
    font-size: 24px;
}

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

.fsbo-form-group:last-child {
    margin-bottom: 0;
}

.fsbo-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
}

.fsbo-form-group .required {
    color: var(--error-color);
    font-weight: 700;
}

/* ========================================
   Input Wrapper & Fields
   ======================================== */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix,
.input-suffix {
    position: absolute;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-light);
    pointer-events: none;
}

.input-prefix {
    left: 15px;
}

.input-suffix {
    right: 15px;
}

.fsbo-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-background);
    color: var(--text-color);
    transition: var(--transition);
    font-family: inherit;
}

.fsbo-input.currency-input {
    padding-left: 35px;
    text-align: right;
}

.fsbo-input.percent-input {
    padding-right: 35px;
    text-align: right;
}

.fsbo-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.1);
}

.fsbo-input:hover:not(:focus):not([readonly]) {
    border-color: var(--secondary-color);
}

.fsbo-input[readonly] {
    background: var(--background-color);
    cursor: not-allowed;
    color: var(--text-color);
    font-weight: 600;
}

.fsbo-input::placeholder {
    color: #BDC3C7;
}

/* ========================================
   Calculated Fields
   ======================================== */
.calculated-field {
    background: linear-gradient(135deg, #E8F4F8 0%, #F0F8FA 100%);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--secondary-color);
}

.calculated-field label {
    color: var(--secondary-color);
    font-weight: 600;
}

.calculated-field .fsbo-input {
    background: var(--card-background);
    border-color: var(--secondary-color);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ========================================
   Summary Panel
   ======================================== */
.fsbo-netsheet-summary {
    position: sticky;
    top: 20px;
}

.summary-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.summary-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 25px 0;
    text-align: center;
    color: white;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 16px;
}

.summary-label {
    font-weight: 500;
    opacity: 0.95;
}

.summary-value {
    font-weight: 700;
    font-size: 18px;
}

.summary-divider {
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 20px 0;
}

.summary-total {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px 15px;
    border-radius: var(--border-radius);
    margin-top: 10px;
}

.summary-total .summary-label {
    font-size: 18px;
    font-weight: 600;
}

.summary-total .summary-value {
    font-size: 28px;
    font-weight: 800;
}

.summary-total .summary-value.negative {
    color: #FFE5E5;
}

.summary-total .summary-value.positive {
    color: #D4EDDA;
}

/* ========================================
   Summary Breakdown
   ======================================== */
.summary-breakdown {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.summary-breakdown h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: white;
    opacity: 0.95;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    opacity: 0.9;
}

.breakdown-item span:last-child {
    font-weight: 600;
}

/* ========================================
   Actions
   ======================================== */
.fsbo-netsheet-actions {
    margin-top: 30px;
    text-align: center;
}

.fsbo-button {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-block;
    text-decoration: none;
}

.fsbo-button-secondary {
    background: var(--card-background);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.fsbo-button-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.fsbo-button-secondary:active {
    transform: translateY(0);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .fsbo-netsheet-content {
        grid-template-columns: 1fr;
    }
    
    .fsbo-netsheet-summary {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .fsbo-netsheet-container {
        padding: 20px 15px;
    }
    
    .fsbo-netsheet-title {
        font-size: 26px;
    }
    
    .fsbo-netsheet-subtitle {
        font-size: 14px;
    }
    
    .fsbo-netsheet-section {
        padding: 20px 15px;
    }
    
    .fsbo-section-title {
        font-size: 18px;
    }
    
    .summary-card {
        padding: 20px;
    }
    
    .summary-title {
        font-size: 20px;
    }
    
    .summary-total .summary-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .fsbo-netsheet-title {
        font-size: 22px;
    }
    
    .fsbo-input {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .fsbo-input.currency-input {
        padding-left: 30px;
    }
    
    .input-prefix {
        left: 12px;
        font-size: 14px;
    }
    
    .summary-row {
        font-size: 14px;
    }
    
    .summary-value {
        font-size: 16px;
    }
    
    .summary-total .summary-label {
        font-size: 16px;
    }
    
    .summary-total .summary-value {
        font-size: 20px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .fsbo-netsheet-wrapper {
        background: white;
    }
    
    .fsbo-netsheet-section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .fsbo-netsheet-actions {
        display: none;
    }
    
    .fsbo-netsheet-content {
        grid-template-columns: 1fr;
    }
    
    .summary-card {
        background: white;
        color: var(--text-color);
        border: 2px solid var(--primary-color);
    }
    
    .summary-title,
    .summary-label,
    .summary-value,
    .summary-breakdown h4 {
        color: var(--text-color) !important;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.fsbo-input:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.fsbo-button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
