/* Profit & Loss Statement Generator - Styles */

:root {
    --primary-color: #C62E2E;
    --secondary-color: #1e1e1e;
    --accent-color: #C1E172;
    --background-color: #f8f9fa;
    --text-dark: #1e1e1e;
    --text-muted: #6c757d;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a02525 100%);
    padding: 80px 0 60px;
    color: var(--white);
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: snow;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.95;
    line-height: 1.7;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Tool Section */
.tool-section {
    padding: 60px 0;
}

.tool-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Control Panel */
.control-panel {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.control-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.btn-reset-memory {
    background: var(--danger-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-reset-memory:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Input Sections */
.input-section {
    margin-bottom: 30px;
    padding: 25px;
    background: var(--background-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.input-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(198, 46, 46, 0.1);
}

/* Dynamic Items */
.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    align-items: end;
}

.item-row input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.item-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(198, 46, 46, 0.1);
}

.btn-remove {
    background: var(--danger-color);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-remove:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-add {
    width: 100%;
    background: var(--accent-color);
    color: var(--text-dark);
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 15px;
}

.btn-add:hover {
    background: #b0d062;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: #a02525;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--background-color);
    border-color: var(--text-dark);
    transform: translateY(-2px);
}

/* Results Panel */
.results-panel {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.export-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-export {
    background: var(--accent-color);
    color: var(--text-dark);
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-export:hover:not(:disabled) {
    background: #b0d062;
    transform: translateY(-2px);
}

.btn-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results-content {
    min-height: 400px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

/* P&L Statement Display */
.pl-statement {
    font-family: 'Courier New', monospace;
}

.pl-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px double var(--text-dark);
}

.pl-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.pl-header .company-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.pl-header .period {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.pl-section {
    margin-bottom: 25px;
}

.pl-section-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
}

.pl-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.pl-line:hover {
    background: var(--background-color);
}

.pl-line.total {
    font-weight: 700;
    background: var(--background-color);
    border-top: 2px solid var(--text-dark);
    border-bottom: 2px solid var(--text-dark);
    margin-top: 10px;
}

.pl-line.subtotal {
    font-weight: 600;
    background: #f8f9fa;
    border-top: 1px solid var(--text-muted);
}

.pl-line.net-profit {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--accent-color);
    border: 3px double var(--text-dark);
    margin-top: 20px;
}

.pl-line.net-loss {
    font-size: 1.2rem;
    font-weight: 700;
    background: #ffe0e0;
    border: 3px double var(--danger-color);
    margin-top: 20px;
}

.pl-label {
    flex: 1;
}

.pl-label.indent {
    padding-left: 20px;
    font-size: 0.95rem;
}

.pl-amount {
    font-weight: 600;
    min-width: 120px;
    text-align: right;
}

.pl-amount.negative {
    color: var(--danger-color);
}

.pl-amount.positive {
    color: var(--success-color);
}

/* Financial Metrics */
.financial-metrics {
    margin-top: 30px;
    padding: 20px;
    background: var(--background-color);
    border-radius: 12px;
}

.financial-metrics h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.metric-card {
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Saved Statements */
.saved-statements-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.saved-statements-section h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.saved-statements-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.saved-statement-card {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.saved-statement-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.saved-statement-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.saved-statement-title {
    font-weight: 600;
    color: var(--text-dark);
}

.saved-statement-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.saved-statement-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.saved-statement-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-load,
.btn-delete {
    flex: 1;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-load {
    background: var(--accent-color);
    color: var(--text-dark);
}

.btn-load:hover {
    background: #b0d062;
}

.btn-delete {
    background: var(--danger-color);
    color: var(--white);
}

.btn-delete:hover {
    background: #c82333;
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background: var(--white);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: var(--background-color);
    padding: 35px;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* How To Section */
.how-to-section {
    padding: 80px 0;
    background: var(--background-color);
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.step-number {
    position: absolute;
    top: -20px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.step-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 10px;
    color: var(--text-dark);
}

.step-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a02525 100%);
    color: var(--white);
}

.cta-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: snow;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-cta-primary,
.btn-cta-secondary {
    padding: 16px 40px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-cta-primary {
    background: var(--white);
    color: var(--primary-color);
}

.btn-cta-primary:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-cta-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-cta-secondary:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.cta-features {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: 1rem;
}

/* Content Section */
.content-section {
    padding: 80px 0;
    background: var(--white);
}

.educational-content {
    max-width: 900px;
    margin: 0 auto;
}

.educational-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-dark);
}

.educational-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 35px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.educational-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--text-dark);
}

.educational-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* FAQ Section */
.faq-section {
    padding: 80px 0;
    background: var(--background-color);
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    padding: 20px 25px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--background-color);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
}

.faq-answer p {
    padding: 0 25px 20px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tool-wrapper {
        grid-template-columns: 1fr;
    }
    
    .results-panel {
        position: relative;
        top: 0;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .item-row {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .steps-container {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        width: 100%;
    }
    
    .btn-export {
        flex: 1;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn-cta-primary,
    .btn-cta-secondary {
        width: 100%;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cta-section h2 {
        font-size: 2rem;
    }
    
    .control-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .btn-reset-memory {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .control-panel,
    .results-panel {
        padding: 20px;
    }
    
    .pl-line {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .pl-amount {
        min-width: 90px;
    }
}

/* Print Styles */
@media print {
    .control-panel,
    .hero-section,
    .features-section,
    .how-to-section,
    .cta-section,
    .faq-section,
    .content-section,
    .export-buttons,
    .saved-statements-section {
        display: none !important;
    }
    
    .results-panel {
        box-shadow: none;
        padding: 0;
    }
    
    .pl-statement {
        font-size: 12pt;
    }
}