/**
 * Naija Tax Pro v2.0 - Frontend Styles
 * Modern, interactive, and responsive calculator styling with animations
 */

/* ===================================
   CSS Variables
   =================================== */
:root {
    --ntp-primary: #27ae60;
    --ntp-primary-dark: #229954;
    --ntp-accent: #f39c12;
    --ntp-success: #27ae60;
    --ntp-danger: #e74c3c;
    --ntp-info: #3498db;
    --ntp-warning: #f39c12;
    --ntp-gray-100: #f8f9fa;
    --ntp-gray-200: #e9ecef;
    --ntp-gray-300: #dee2e6;
    --ntp-gray-400: #ced4da;
    --ntp-gray-500: #adb5bd;
    --ntp-gray-600: #6c757d;
    --ntp-gray-700: #495057;
    --ntp-gray-800: #343a40;
    --ntp-gray-900: #212529;
    --ntp-white: #ffffff;
    --ntp-border-radius: 8px;
    --ntp-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    --ntp-transition: all 0.3s ease;
}

/* ===================================
   Calculator Wrapper
   =================================== */
.ntp-calculator-v2-wrapper {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ntp-calculator-v2-container {
    background: var(--ntp-white);
    border-radius: var(--ntp-border-radius);
    box-shadow: var(--ntp-box-shadow);
    overflow: hidden;
}

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

.ntp-title {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.ntp-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 400;
}

/* ===================================
   Type Selector
   =================================== */
.ntp-type-selector {
    display: flex;
    gap: 15px;
    padding: 30px;
    justify-content: center;
    background: var(--ntp-gray-100);
    border-bottom: 1px solid var(--ntp-gray-300);
}

.ntp-type-btn {
    flex: 1;
    max-width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--ntp-white);
    border: 2px solid var(--ntp-gray-300);
    border-radius: var(--ntp-border-radius);
    cursor: pointer;
    transition: var(--ntp-transition);
    font-size: 16px;
    font-weight: 600;
    color: var(--ntp-gray-700);
}

.ntp-type-btn svg {
    transition: var(--ntp-transition);
}

.ntp-type-btn:hover {
    border-color: var(--ntp-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.ntp-type-btn.active {
    background: var(--ntp-primary);
    border-color: var(--ntp-primary);
    color: var(--ntp-white);
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
}

.ntp-type-btn.active svg {
    stroke: var(--ntp-white);
}

/* ===================================
   Form Styles
   =================================== */
.ntp-form-v2 {
    padding: 30px;
}

.ntp-calculator-fields {
    animation: fadeIn 0.4s ease;
}

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

/* Comparison Toggle */
.ntp-comparison-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--ntp-info);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(39, 174, 96, 0.1) 100%);
    border-radius: var(--ntp-border-radius);
    border: 1px solid var(--ntp-info);
}

.ntp-comparison-toggle label {
    cursor: pointer;
    font-weight: 500;
    color: var(--ntp-gray-800);
    margin: 0;
}

/* Toggle Switch */
.ntp-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.ntp-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ntp-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ntp-gray-400);
    transition: 0.4s;
    border-radius: 26px;
}

.ntp-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .ntp-slider {
    background-color: var(--ntp-primary);
}

input:checked + .ntp-slider:before {
    transform: translateX(24px);
}

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

.ntp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--ntp-gray-800);
    font-size: 14px;
}

.ntp-form-group label .required {
    color: var(--ntp-danger);
    margin-left: 3px;
}

.ntp-help-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--ntp-gray-400);
    color: var(--ntp-white);
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
    margin-left: 5px;
}

/* Input Fields */
.ntp-input,
.ntp-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--ntp-gray-300);
    border-radius: var(--ntp-border-radius);
    background: var(--ntp-white);
    transition: var(--ntp-transition);
    font-family: inherit;
}

.ntp-input:focus,
.ntp-select:focus {
    outline: none;
    border-color: var(--ntp-primary);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Split Input Groups */
.ntp-input-group {
    display: flex;
    gap: 0;
}

.ntp-input-left {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.ntp-input-right {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    width: 80px;
    flex-shrink: 0;
}

/* Form Actions */
.ntp-form-actions {
    margin-top: 30px;
}

/* Buttons */
.ntp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--ntp-border-radius);
    cursor: pointer;
    transition: var(--ntp-transition);
    text-decoration: none;
    font-family: inherit;
}

.ntp-btn svg {
    flex-shrink: 0;
}

.ntp-btn-primary {
    background: var(--ntp-primary);
    color: var(--ntp-white);
    width: 100%;
}

.ntp-btn-primary:hover:not(:disabled) {
    background: var(--ntp-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.ntp-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ntp-btn-secondary {
    background: var(--ntp-gray-200);
    color: var(--ntp-gray-800);
}

.ntp-btn-secondary:hover {
    background: var(--ntp-gray-300);
    transform: translateY(-1px);
}

.ntp-btn-success {
    background: #25D366;
    color: var(--ntp-white);
}

.ntp-btn-success:hover {
    background: #20ba5a;
    transform: translateY(-1px);
}

.ntp-btn-outline {
    background: transparent;
    color: var(--ntp-gray-700);
    border: 2px solid var(--ntp-gray-300);
}

.ntp-btn-outline:hover {
    background: var(--ntp-gray-100);
    border-color: var(--ntp-gray-400);
}

/* Loading State */
.ntp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 30px;
    text-align: center;
    color: var(--ntp-gray-600);
}

.ntp-spinner-v2 {
    width: 50px;
    height: 50px;
    border: 4px solid var(--ntp-gray-200);
    border-top-color: var(--ntp-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Messages */
.ntp-message {
    padding: 15px 20px;
    border-radius: var(--ntp-border-radius);
    margin: 20px 0;
    font-size: 14px;
}

.ntp-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
}

/* ===================================
   Results Section
   =================================== */
.ntp-results-v2 {
    margin-top: 40px;
    padding: 30px;
    background: var(--ntp-gray-100);
    border-top: 3px solid var(--ntp-primary);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

.ntp-results-title {
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--ntp-gray-900);
    text-align: center;
}

/* Comparison Message */
.ntp-comparison-message {
    margin-bottom: 30px;
    text-align: center;
}

.ntp-comparison-message > div {
    display: inline-block;
    padding: 15px 30px;
    border-radius: var(--ntp-border-radius);
    font-size: 18px;
    font-weight: 600;
}

.ntp-savings {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(39, 174, 96, 0.2) 100%);
    color: var(--ntp-success);
    border: 2px solid var(--ntp-success);
}

.ntp-increase {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.2) 100%);
    color: var(--ntp-danger);
    border: 2px solid var(--ntp-danger);
}

/* Comparison Grid */
.ntp-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.ntp-comparison-column {
    background: var(--ntp-white);
    border-radius: var(--ntp-border-radius);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ntp-comparison-column.ntp-highlighted {
    border: 2px solid var(--ntp-primary);
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.15);
}

.ntp-column-title {
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ntp-gray-800);
    border-bottom: 2px solid var(--ntp-gray-200);
    text-align: center;
}

/* Results Table */
.ntp-results-table {
    background: var(--ntp-white);
    border-radius: var(--ntp-border-radius);
    padding: 20px;
}

.ntp-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--ntp-gray-200);
}

.ntp-result-row:last-child {
    border-bottom: none;
}

.ntp-result-label {
    font-weight: 500;
    color: var(--ntp-gray-700);
    flex: 1;
}

.ntp-result-value {
    font-weight: 700;
    color: var(--ntp-gray-900);
    text-align: right;
}

/* Result Row Variations */
.ntp-breakdown .ntp-result-label {
    padding-left: 20px;
    font-weight: normal;
    font-size: 14px;
    color: var(--ntp-gray-600);
}

.ntp-breakdown .ntp-result-value {
    font-weight: 600;
    font-size: 14px;
}

.ntp-result-section-title {
    font-weight: 700;
    color: var(--ntp-primary);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--ntp-gray-200);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ntp-result-row.ntp-highlight {
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.05) 0%, rgba(39, 174, 96, 0.1) 100%);
    padding: 15px;
    margin: 10px -20px;
    border-left: 4px solid var(--ntp-primary);
    border-bottom: none;
}

.ntp-result-row.ntp-highlight-primary {
    background: linear-gradient(90deg, rgba(243, 156, 18, 0.05) 0%, rgba(243, 156, 18, 0.1) 100%);
    padding: 15px;
    margin: 10px -20px;
    border-left: 4px solid var(--ntp-accent);
    border-bottom: none;
}

.ntp-result-row.ntp-highlight-primary .ntp-result-value {
    color: var(--ntp-accent);
    font-size: 20px;
}

.ntp-result-row.ntp-highlight-success {
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.1) 0%, rgba(39, 174, 96, 0.15) 100%);
    padding: 15px;
    margin: 10px -20px;
    border-left: 4px solid var(--ntp-success);
    border-bottom: none;
}

.ntp-result-row.ntp-highlight-success .ntp-result-value {
    color: var(--ntp-success);
    font-size: 18px;
}

/* Badge */
.ntp-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--ntp-primary);
    color: var(--ntp-white);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Chart Container */
.ntp-chart-container {
    background: var(--ntp-white);
    border-radius: var(--ntp-border-radius);
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Results Actions */
.ntp-results-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.ntp-results-actions .ntp-btn {
    flex: 1;
    min-width: 180px;
}

/* Disclaimer */
.ntp-disclaimer {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid var(--ntp-accent);
    border-radius: var(--ntp-border-radius);
    font-size: 13px;
    line-height: 1.6;
    color: var(--ntp-gray-700);
}

.ntp-disclaimer svg {
    flex-shrink: 0;
    color: var(--ntp-accent);
    margin-top: 2px;
}

.ntp-disclaimer p {
    margin: 0;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .ntp-calculator-v2-wrapper {
        padding: 0 15px;
        margin: 20px auto;
    }

    .ntp-header {
        padding: 20px;
    }

    .ntp-title {
        font-size: 22px;
    }

    .ntp-subtitle {
        font-size: 14px;
    }

    .ntp-type-selector {
        flex-direction: column;
        padding: 20px;
    }

    .ntp-type-btn {
        max-width: 100%;
    }

    .ntp-form-v2 {
        padding: 20px;
    }

    .ntp-comparison-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ntp-results-v2 {
        padding: 20px;
    }

    .ntp-result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .ntp-result-value {
        text-align: left;
        font-size: 16px;
    }

    .ntp-results-actions {
        flex-direction: column;
    }

    .ntp-results-actions .ntp-btn {
        width: 100%;
    }
}

/* ===================================
   Accessibility
   =================================== */
.ntp-input:focus,
.ntp-select:focus,
.ntp-btn:focus {
    outline: 2px solid var(--ntp-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .ntp-calculator-v2-container {
        border: 2px solid #000;
    }

    .ntp-input,
    .ntp-select {
        border-width: 2px;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .ntp-type-selector,
    .ntp-form-v2,
    .ntp-results-actions {
        display: none;
    }

    .ntp-calculator-v2-container {
        box-shadow: none;
    }

    .ntp-results-v2 {
        background: white;
    }
}
