/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
    border-bottom: 3px solid #5568d3;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    border: none;
    background: transparent;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: white;
    color: #667eea;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* Document Sections */
.document-section {
    display: none;
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

.document-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Account Section Styling */
.account-section {
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.account-title {
    text-align: center;
    color: #667eea;
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
    font-weight: bold;
    text-transform: uppercase;
}

.period-header {
    text-align: center;
    color: #764ba2;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.company-info {
    margin: 15px 0;
    line-height: 1.8;
    color: #555;
}

.company-info p {
    margin: 5px 0;
}

.company-info strong {
    color: #667eea;
    font-size: 20px;
}

[contenteditable="true"] {
    background: rgba(102, 126, 234, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: text;
    transition: background 0.3s ease;
}

[contenteditable="true"]:hover {
    background: rgba(102, 126, 234, 0.1);
}

[contenteditable="true"]:focus {
    outline: 2px solid #667eea;
    background: white;
}

/* Table Styles */
.financial-table {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

thead th {
    color: white;
    padding: 18px 15px;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s ease;
}

tbody tr:hover {
    background: #f8f9ff;
}

tbody td {
    padding: 15px;
    text-align: left;
}

/* Section Headers */
.section-header td {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-weight: bold;
    padding: 12px 15px !important;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Special styling for Trading and P&L headers */
.trading-header td,
.pl-header td {
    text-align: center;
    font-size: 16px;
    text-transform: uppercase;
}

/* Input Styles */
.amount-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
    color: #333;
}

.amount-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amount-input:hover {
    border-color: #764ba2;
}

.small-input {
    width: 60px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

.small-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Calculated Amounts */
.calculated-amount {
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 15px;
}

.calculated-row {
    background: #f0f9ff !important;
}

.calculated-row td {
    font-weight: 600;
    color: #1e40af;
}

/* Total Row */
.total-row {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.total-row td {
    color: white !important;
    font-weight: bold;
    font-size: 16px;
    padding: 15px !important;
}

.total-amount {
    font-weight: bold;
    color: white !important;
    font-size: 18px;
    padding: 10px 15px;
    border-radius: 6px;
}

/* Difference Row */
.difference-row {
    background: #fef3c7 !important;
}

.difference-row td {
    font-weight: bold;
    color: #92400e;
}

.difference-amount {
    font-weight: bold;
    font-size: 16px;
    padding: 10px 15px;
}

/* Final Row */
.final-row {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.final-row td {
    color: white !important;
    font-weight: bold;
    font-size: 17px;
    padding: 15px !important;
}

.final-amount {
    font-weight: bold;
    color: white !important;
    font-size: 18px;
}

/* Summary Box */
.summary-box {
    display: flex;
    justify-content: space-around;
    margin: 25px 0;
    gap: 20px;
}

.summary-item {
    flex: 1;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-5px);
}

.summary-item span:first-child {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.summary-item span:last-child {
    display: block;
    font-size: 24px;
    font-weight: bold;
}

/* Print Section */
.print-section {
    text-align: center;
    padding: 30px;
    background: #f8f9ff;
    border-top: 3px solid #667eea;
}

.print-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.print-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.print-btn:active {
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .document-section {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header h2 {
        font-size: 16px;
    }
    
    table {
        font-size: 14px;
    }
    
    thead th {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    tbody td {
        padding: 10px 8px;
    }
    
    .summary-box {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .tabs,
    .print-section {
        display: none !important;
    }
    
    .document-section {
        display: block !important;
        padding: 20px;
    }
    
    .document-section:not(.active) {
        display: none !important;
    }
    
    .header {
        background: white !important;
        box-shadow: none;
        border: 2px solid #667eea;
    }
    
    table {
        box-shadow: none;
    }
    
    tbody tr:hover {
        background: white;
    }
    
    .amount-input {
        border: none;
        padding: 5px;
        background: transparent;
        font-weight: 600;
    }
    
    [contenteditable="true"] {
        background: transparent;
    }
}

/* Animation for calculated values */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.calculated-amount.updating {
    animation: pulse 0.5s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}