/* Sales Dashboard Styles */
/* Following plan.txt section 8.3: Separate concerns (functions, CSS, etc.) */

/* Experimental Sales Quote System - Styles */

/* Layout Structure */
body { 
    background: #f8f9fa; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    display: flex; 
    flex-direction: row; 
    margin: 0; 
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Authentication Gate */
#auth-gate { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: #2c3e50; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 9999; 
    color: white; 
    text-align: center; 
}

.auth-box { 
    background: #fff; 
    padding: 40px; 
    border-radius: 8px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    color: #333; 
    width: 320px; 
}

.auth-box h2 { 
    margin-top: 0; 
    color: #d00; 
    font-size: 18px; 
}

.auth-input { 
    width: 100%; 
    padding: 10px; 
    margin-bottom: 15px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    box-sizing: border-box; 
}

.auth-button { 
    width: 100%; 
    padding: 12px; 
    background: #d00; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 16px; 
}

.auth-button:hover { 
    background: #b00; 
}

#auth-error { 
    color: #d00; 
    font-size: 12px; 
    margin-top: 10px; 
    display: none; 
}

/* Sidebar Styles (Inspired by their design) */
#app {
    display: flex;
    width: 100vw;
    height: 100vh;
}

#sidebar {
    width: 280px;
    background: transparent;
    color: #343a40;
    display: flex; 
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 20px; 
    font-weight: 700; 
    margin-bottom: 25px; 
    text-align: center; 
    color: #343a40;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
}

.nav-section {
    margin-bottom: 30px;
}


.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.nav-button { 
    width: 100%; 
    padding: 10px 15px; 
    background: transparent; 
    color: #6c757d; 
    border: 1px solid #dee2e6; 
    border-radius: 4px; 
    font-size: 12px; 
    font-weight: bold; 
    cursor: pointer; 
    margin-bottom: 10px; 
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-button:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.nav-button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.nav-button i {
    width: 16px;
    text-align: center;
}

/* Terminal Styles */
.info { color: #00ff00; }
.success { color: #00ff00; font-weight: bold; }
.error { color: #ff4444; font-weight: bold; }

/* Main Container */
#main-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow-y: auto;
}

/* Top Bar */
.top-bar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.top-actions {
    display: flex;
    gap: 10px;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-success:hover {
    background: #218838;
}

/* Content Area */
.content-area {
    flex-grow: 1;
    padding: 25px;
    background: #f8f9fa;
}

/* Quote Canvas */
.quote-canvas { 
    background-color: white; 
    max-width: 1000px; 
    margin: 0 auto;
    padding: 30px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Wider canvas for quotes list */
#list-quotes-section .quote-canvas {
    max-width: 1400px;
    box-sizing: border-box;
    position: relative;
    border-radius: 4px;
}

/* Quote Header */
.quote-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 20px;
}

.quote-title {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.quote-subtitle {
    font-size: 16px;
    color: #7f8c8d;
}

/* Form Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

td {
    padding: 10px;
    border: 1px solid #ddd;
}

.label {
    font-weight: bold;
    background: #f8f9fa;
    width: 150px;
}

input[type="text"], input[type="number"], input[type="email"], select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.editable-content {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    min-height: 60px;
    background: white;
}

.editable-content:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.section-header {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.content-box {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Line Items Table */
.line-items-table {
    width: 100%;
    border-collapse: collapse;
}

.line-items-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #ddd;
}

.line-items-table td {
    padding: 8px;
    border: 1px solid #ddd;
}

.line-items-table input {
    width: 100%;
    border: none;
    padding: 4px;
    background: transparent;
}

.btn-remove-row {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
}

.btn-remove-row:hover {
    background: #c0392b;
}

/* Totals Section */
.totals-section {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.totals-grand {
    font-weight: bold;
    font-size: 18px;
    border-top: 2px solid #3498db;
    padding-top: 10px;
    margin-top: 15px;
}

/* 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-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

/* Product Table Styles */
.product-table {
    width: 100%;
    border-collapse: collapse;
}

.product-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #ddd;
}

.product-table td {
    padding: 8px;
    border: 1px solid #ddd;
}

.product-name-display, .product-price-display {
    cursor: pointer;
}

.product-name-display:hover, .product-price-display:hover {
    background: #fff3cd;
}

/* Contact List Styles */
.contact-list {
    max-height: 300px;
    overflow-y: auto;
}

.contact-item {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

.contact-item:hover {
    background: #f8f9fa;
}

.search-box {
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
