/* Merged styles for Profit Calculator - Combining styles.css and styles_enhanced.css */

/* Color Variables */
:root {
    --navy-blue: #0a2463;
    --royal-blue: #1e56a0;
    --sky-blue: #4d9de0;
    --light-blue: #e6f2ff;
    --accent-orange: #ff6b35;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #e2e8f0;
    --dark-gray: #4a5568;
    --text-dark: #2d3748;
    --text-light: #e2e8f0;
}

/* General styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f8fafc;
    color: #333;
}

/* Navigation Bar */
.navbar {
    background: linear-gradient(135deg, #1e56a0 0%, #0a2463 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.1);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Header */
.header-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.header-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.header-container h1 i {
    color: #1e56a0;
    margin-right: 10px;
}

/* Currency selector styles */
.currency-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.currency-selector label {
    margin-right: 10px;
    font-weight: bold;
    color: #555;
}

.currency-selectors {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.currency-selector {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    min-width: 200px;
}

.currency-selector select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Enhanced Currency Selector Styles */
.currency-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-select {
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-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='currentColor' 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 10px center;
    background-size: 1em;
    border: 2px solid var(--medium-gray);
    border-radius: 6px;
}

.currency-select:focus {
    border-color: var(--royal-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 86, 160, 0.2);
}

.currency-info {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.currency-info {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.currency-symbol {
    font-weight: bold;
    color: var(--royal-blue);
}

.currency-badge {
    background: var(--light-blue);
    border-radius: 8px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 3px solid var(--royal-blue);
}

.currency-label {
    font-weight: 600;
    color: var(--navy-blue);
    font-size: 0.9rem;
}

.currency-value {
    color: var(--royal-blue);
    font-weight: 700;
}

/* Form Container */
.form-container {
    margin-bottom: 2rem;
    text-align: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--navy-blue) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 86, 160, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: var(--white);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e55025 100%);
    color: var(--white);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

/* Item Cards */
.item-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid var(--royal-blue);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.item-number {
    font-weight: bold;
    color: var(--royal-blue);
    font-size: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 3px rgba(30, 86, 160, 0.1);
}

.form-group select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 3px rgba(30, 86, 160, 0.1);
}

.readonly-input {
    background-color: #f8fafc;
    cursor: not-allowed;
}

.item-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    margin-top: 1rem;
}

.total-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.total-item label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.total-item span {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

/* Summary Container */
.summary-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.summary-container h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
}

.summary-container h2 i {
    color: #667eea;
    margin-right: 10px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.summary-item {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--navy-blue) 100%);
    border-radius: 10px;
    color: white;
}

.summary-item label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.summary-item span {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.dashboard-header h1 i {
    color: #1e56a0;
    margin-right: 10px;
}

.dashboard-header p {
    color: #666;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--navy-blue) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.stat-content p {
    color: #666;
    font-weight: 600;
}

.recent-calculations {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.recent-calculations h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.calculations-list {
    display: grid;
    gap: 1rem;
}

.calculation-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #1e56a0;
}

/* History Page Styles */
.calculations-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.calculation-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--royal-blue);
}

.calculation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.calculation-header h3 {
    color: #333;
    margin: 0;
}

.calculation-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.calculation-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

.stat .label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat .value {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

.calculation-items {
    background: white;
    padding: 1rem;
    border-radius: 6px;
}

.calculation-items h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.item-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f1f1;
}

.item-summary:last-child {
    border-bottom: none;
}

/* Table Styles */
.table-container {
    margin-top: 20px;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.calculations-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.calculations-table th {
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--navy-blue) 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.calculations-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.calculations-table tr:hover {
    background-color: #f8f9fa;
}

.calculations-table tr:last-child td {
    border-bottom: none;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-view, .btn-edit, .btn-delete {
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-view {
    background: #4d9de0;
    color: white;
}

.btn-view:hover {
    background: #3a8bc9;
}

.btn-edit {
    background: #ffc107;
    color: #212529;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--navy-blue) 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-body {
    padding: 20px;
    background: white;
    border-radius: 0 0 8px 8px;
    max-height: 70vh;
    overflow-y: auto;
}

.calculation-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.items-list h4 {
    margin-bottom: 15px;
    color: #495057;
    border-bottom: 2px solid var(--royal-blue);
    padding-bottom: 8px;
}

.item-detail {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.item-detail strong {
    display: block;
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.1rem;
}

.item-detail div {
    margin-bottom: 5px;
    color: #6c757d;
}

.item-detail div:last-child {
    margin-bottom: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Positive/Negative Values */
.positive {
    color: #4CAF50;
}

.negative {
    color: var(--accent-orange);
}

/* Dark Mode Enhancements */
.dark-theme {
    background-color: #1a202c;
    color: var(--text-light);
}

.dark-theme .navbar {
    background: linear-gradient(135deg, var(--navy-blue) 0%, #0a1a40 100%);
}

.dark-theme .card-header,
.dark-theme .modal-header {
    background: linear-gradient(135deg, var(--navy-blue) 0%, #0a1a40 100%);
}

.dark-theme .calculation-card,
.dark-theme .item-card,
.dark-theme .modal-content,
.dark-theme .stat-card {
    background-color: #2d3748;
    border-color: var(--navy-blue);
}

.dark-theme .form-group input,
.dark-theme .form-group select {
    background-color: #1a202c;
    border-color: var(--navy-blue);
    color: var(--text-light);
}

.dark-theme .currency-badge {
    background-color: #2d3748;
    border-left: 3px solid var(--accent-orange);
}

.dark-theme .currency-label {
    color: var(--accent-orange);
}

.dark-theme .currency-value {
    color: var(--text-light);
}

.dark-theme .currency-symbol {
    color: var(--accent-orange);
}

.dark-theme .calculation-summary {
    background-color: #2d3748;
}

.dark-theme .summary-item label {
    color: var(--accent-orange);
}

.dark-theme .summary-item span {
    color: var(--text-light);
}

.dark-theme .item-detail {
    background-color: #2d3748;
    border-color: var(--accent-orange);
}

.dark-theme .calculations-table {
    background-color: #2d3748;
}

.dark-theme .calculations-table th {
    background: linear-gradient(135deg, var(--navy-blue) 0%, #0a1a40 100%);
}

.dark-theme .calculations-table td {
    border-color: var(--accent-orange);
}

.dark-theme .calculations-table tr:hover {
    background-color: #1a202c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .currency-selectors {
        flex-direction: column;
        align-items: center;
    }
    
    .currency-selector {
        width: 100%;
        max-width: 300px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .item-totals {
        grid-template-columns: 1fr;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .calculation-details {
        grid-template-columns: 1fr;
    }
    
    .calculation-stats {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .calculations-table {
        font-size: 0.8rem;
    }
    
    .calculations-table th,
    .calculations-table td {
        padding: 8px 4px;
    }
    
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .currency-info {
        flex-direction: column;
        align-items: center;
    }
    
    .currency-badge {
        width: 100%;
        justify-content: space-between;
    }
    
    .calculation-summary {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px auto;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header-container h1 {
        font-size: 2rem;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles for PDF Export */
@media print {
    body {
        background: white;
        font-size: 12pt;
    }
    
    .navbar, .header-controls, .modal-actions, .card-footer {
        display: none !important;
    }
    
    .container, .modal-content, .calculation-card {
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
    }
    
    .calculation-header h3 {
        font-size: 18pt;
        margin-bottom: 10pt;
        color: var(--navy-blue);
    }
    
    .calculation-summary {
        page-break-inside: avoid;
    }
    
    .item-detail {
        page-break-inside: avoid;
        border: 1px solid var(--medium-gray);
        margin-bottom: 10pt;
    }
    
    .currency-badge {
        border: 1px solid var(--medium-gray);
        border-left: 3px solid var(--royal-blue);
    }
}
