/* Modern Investment Calculator Styles */

.modern-calculator {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Header Styles */
.calculator-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.main-title i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
}

/* Panel Card Styles */
.panel-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px 25px;
    border-bottom: none;
}

.card-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.card-header h3 i {
    margin-right: 10px;
    color: #ffd700;
}

.card-body {
    padding: 30px;
}

/* Input Panel Styles */
.input-panel {
    margin-bottom: 30px;
}

.amount-input-group {
    text-align: center;
}

.input-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.input-label i {
    margin-right: 8px;
    color: #4facfe;
}

.amount-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.currency-symbol {
    font-size: 2rem;
    font-weight: bold;
    color: #4facfe;
    margin-right: 10px;
}

.amount-input {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    padding: 15px 20px;
    width: 300px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.amount-input:focus {
    border-color: #4facfe;
    box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
    background: white;
    outline: none;
}

.amount-formatted {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
    font-weight: 500;
}

.quick-amounts {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-quick {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-quick:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Date Selection Styles */
.date-panel {
    margin-bottom: 30px;
}

.date-selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.date-input-group {
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-calculate {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn-reset {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.btn-reset:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn-calculate i,
.btn-reset i {
    margin-right: 8px;
}

/* Results Dashboard */
.results-dashboard {
    margin-top: 40px;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

.section-title i {
    margin-right: 15px;
    color: #4facfe;
}

/* Profit Cards */
.profit-summary {
    margin-bottom: 40px;
}

.profit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.profit-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 5px solid;
}

.profit-card.positive {
    border-left-color: #28a745;
}

.profit-card.negative {
    border-left-color: #dc3545;
}

.profit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.profit-card.positive .card-icon {
    color: #28a745;
}

.profit-card.negative .card-icon {
    color: #dc3545;
}

.card-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.profit-value {
    font-size: 2rem;
    font-weight: bold;
}

.profit-card.positive .profit-value {
    color: #28a745;
}

.profit-card.negative .profit-value {
    color: #dc3545;
}

/* Modern Table Styles */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.modern-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modern-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table th i {
    margin-right: 8px;
    color: #ffd700;
}

.modern-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.modern-table tbody tr:hover {
    background-color: #f8f9fa;
}

.period-cell {
    font-weight: 600;
    color: #4facfe;
}

.amount-cell {
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* Comparison Section */
.comparison-section {
    margin-top: 30px;
}

.btn-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.btn-toggle:hover {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-calculator {
        padding: 10px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .date-selection-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .profit-cards {
        grid-template-columns: 1fr;
    }
    
    .amount-input {
        width: 100%;
        max-width: 300px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-calculate,
    .btn-reset {
        width: 100%;
        max-width: 300px;
    }
    
    .quick-amounts {
        justify-content: center;
    }
    
    .modern-table {
        font-size: 0.9rem;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .calculator-header {
        padding: 20px 15px;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .amount-input {
        font-size: 1.5rem;
        padding: 12px 15px;
    }
    
    .profit-value {
        font-size: 1.5rem;
    }
}

/* Animation for loading states */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-card {
    animation: fadeIn 0.6s ease-out;
}

/* Year Selector Styles */
.year-selector-group {
    width: 100%;
}

.modern-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.modern-select:focus {
    border-color: #4facfe;
    box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
    outline: none;
}

.modern-select:hover {
    border-color: #4facfe;
}

.modern-select option {
    padding: 10px;
    font-weight: 500;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-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: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* History Management Specific Styles */

/* Action Panel */
.action-panel {
    margin-bottom: 30px;
}

/* Error Panel */
.error-panel {
    margin-bottom: 30px;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    font-weight: 500;
}

.error-message i {
    color: #dc3545;
    font-size: 1.2rem;
}

.error-actions {
    margin-top: 15px;
    text-align: center;
}

/* Search Panel */
.search-panel {
    margin-bottom: 30px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.search-group {
    display: flex;
    flex-direction: column;
}

.search-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Data Panel */
.data-panel {
    margin-bottom: 30px;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #4facfe;
    font-size: 1.2rem;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-data i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ddd;
    display: block;
}

.no-data p {
    font-size: 1.2rem;
    margin: 0;
}

/* Table Cell Types */
.id-cell {
    font-weight: 600;
    color: #4facfe;
    text-align: center;
    width: 60px;
}

.date-cell {
    font-weight: 600;
    color: #333;
    text-align: center;
    width: 100px;
}

.actions-cell {
    text-align: center;
    width: 120px;
}

/* Action Buttons */
.btn-edit {
    background: linear-gradient(135deg, #ffc107 0%, #ffeb3b 100%);
    color: #333;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content.delete-modal {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-header h3 i {
    margin-right: 10px;
    color: #ffd700;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-control {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: #4facfe;
    box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
    outline: none;
}

.form-control:hover {
    border-color: #4facfe;
}

/* Validation Styles */
.validation-summary {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
}

/* Delete Info */
.delete-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #dc3545;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: notificationSlideIn 0.3s ease-out;
    max-width: 400px;
}

.notification.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-left: auto;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn-calculate,
    .btn-reset,
    .btn-delete {
        width: 100%;
    }
    
    .search-grid {
        grid-template-columns: 1fr;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Chart Container Styles */
.chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.chart-container canvas {
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
}

/* Performance Value Styling */
.positive-value {
    color: #28a745 !important;
    font-weight: 600;
}

.negative-value {
    color: #dc3545 !important;
    font-weight: 600;
}

/* Enhanced Table Styling for Performance Comparison */
.modern-table .positive-value {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
}

.modern-table .negative-value {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
}

/* Chart Animation */
@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-container {
    animation: chartFadeIn 0.6s ease-out;
}

/* Table Responsive Improvements */
@media (max-width: 1200px) {
    .modern-table {
        font-size: 0.9rem;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
    }
    
    .modern-table {
        min-width: 800px;
    }
    
    .actions-cell {
        position: sticky;
        right: 0;
        background: white;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    }
    
    .chart-container {
        height: 300px;
        padding: 15px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 250px;
        padding: 10px;
        margin: 10px 0;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
}