/* ===================================
   Business Investment Calculator Styles
   =================================== */

/* CSS Variables for easy customization */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --text-dark: #1f2937;
    --text-medium: #6b7280;
    --text-light: #9ca3af;
    
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Calculator Wrapper */
.calculator-wrapper {
    padding: 40px 30px;
}

/* Input Sections */
.input-section {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.input-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input:hover {
    border-color: var(--text-medium);
}

/* Tooltips */
.tooltip {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 0.8rem;
    cursor: help;
    margin-left: 5px;
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    white-space: normal;
    width: 250px;
    font-size: 0.85rem;
    z-index: 1000;
    margin-bottom: 5px;
    box-shadow: var(--shadow-md);
    font-weight: normal;
}

/* Cost Summary */
.cost-summary {
    background: white;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    border: 2px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.cost-summary strong {
    color: var(--text-dark);
}

.cost-summary span {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.3rem;
}

/* Calculate Section */
.calculate-section {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-calculate,
.btn-reset {
    flex: 1;
    min-width: 200px;
    padding: 16px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-calculate {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-reset {
    background: white;
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-reset:hover {
    background: var(--bg-light);
    border-color: var(--text-medium);
}

/* Results Wrapper */
.results-wrapper {
    padding: 40px 30px;
    background: var(--bg-light);
    border-top: 3px solid var(--primary-color);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Score Card */
.score-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.score-header h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.score-display {
    margin: 30px 0;
}

.score-value {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 5px;
}

.recommendation {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 25px;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.rec-icon {
    font-size: 2rem;
}

/* Recommendation Colors */
.recommendation.good {
    background: var(--success-color);
}

.recommendation.marginal {
    background: var(--warning-color);
}

.recommendation.poor {
    background: var(--danger-color);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.metric-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.metric-detail {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Detailed Breakdown */
.detailed-breakdown {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.detailed-breakdown h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.breakdown-grid {
    display: grid;
    gap: 15px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border-color);
}

.breakdown-item.highlight {
    background: rgba(37, 99, 235, 0.05);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.breakdown-label {
    color: var(--text-medium);
    font-size: 0.95rem;
}

.breakdown-value {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Chart Section */
.chart-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.chart-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.chart-container {
    position: relative;
    height: 400px;
}

/* Export Section */
.export-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.export-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.export-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-export {
    flex: 1;
    min-width: 200px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-pdf {
    background: var(--danger-color);
    color: white;
}

.btn-pdf:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-email {
    background: var(--primary-color);
    color: white;
}

.btn-email:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Email Form */
.email-form {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 2px solid var(--primary-color);
    animation: slideIn 0.3s ease;
}

.email-form h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-send,
.btn-cancel {
    flex: 1;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-send {
    background: var(--success-color);
    color: white;
}

.btn-send:hover {
    background: #059669;
}

.btn-cancel {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-cancel:hover {
    background: var(--border-color);
}

/* Email Status */
.email-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-align: center;
    display: none;
}

.email-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
    display: block;
}

.email-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    display: block;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

.footer p {
    margin: 5px 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .calculator-wrapper,
    .results-wrapper {
        padding: 20px 15px;
    }

    .input-section {
        padding: 20px 15px;
    }

    .score-card {
        padding: 25px 20px;
    }

    .score-value {
        font-size: 3.5rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .calculate-section,
    .export-buttons,
    .form-buttons {
        flex-direction: column;
    }

    .btn-calculate,
    .btn-reset,
    .btn-export,
    .btn-send,
    .btn-cancel {
        width: 100%;
        min-width: auto;
    }

    .chart-container {
        height: 300px;
    }

    .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .header,
    .calculate-section,
    .export-section,
    .email-form,
    .footer {
        display: none;
    }

    .container {
        box-shadow: none;
    }
}

/* Loading State */
.btn-calculate.loading {
    position: relative;
    color: transparent;
}

.btn-calculate.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Cloudflare Turnstile */
.cf-turnstile {
    margin: 15px 0;
}

/* Select dropdown styling */
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select:hover {
    border-color: var(--text-medium);
}