/* ========================================
   OPTICAL JOB CARD PLUGIN STYLES
   ======================================== */

/* Floating Button */
.ojc-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ojc-floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.ojc-btn-icon {
    font-size: 20px;
}

/* Modal */
.ojc-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ojc-modal.active {
    display: flex;
}

.ojc-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: ojcSlideIn 0.3s ease;
}

.ojc-modal-large {
    max-width: 900px;
}

@keyframes ojcSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ojc-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ojc-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ojc-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ojc-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ojc-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* Tabs */
.ojc-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.ojc-tab {
    background: #f3f4f6;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    color: #374151;
}

.ojc-tab:hover {
    background: #e5e7eb;
}

.ojc-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ojc-tab-pane {
    display: none;
}

.ojc-tab-pane.active {
    display: block;
}

/* Buttons */
.ojc-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.ojc-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.ojc-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ojc-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ojc-btn-large {
    padding: 15px 40px;
    font-size: 18px;
}

.ojc-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Quick Create Section */
.ojc-quick-create {
    text-align: center;
    padding: 30px 20px;
}

.ojc-quick-create p {
    color: #6b7280;
    margin-bottom: 25px;
    font-size: 15px;
}

.ojc-quick-result {
    margin-top: 30px;
    padding: 25px;
    background: #f0fdf4;
    border-radius: 12px;
    border: 2px solid #10b981;
}

.ojc-quick-result.error {
    background: #fef2f2;
    border-color: #ef4444;
}

.ojc-job-number-display {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    color: #059669;
    margin: 15px 0;
}

.ojc-qr-code {
    margin: 20px auto;
    padding: 15px;
    background: white;
    display: inline-block;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Search Bar */
.ojc-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ojc-search-bar input,
.ojc-search-bar select {
    flex: 1;
    min-width: 150px;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ojc-search-bar input:focus,
.ojc-search-bar select:focus {
    outline: none;
    border-color: #667eea;
}

/* Jobs List */
.ojc-jobs-list {
    max-height: 400px;
    overflow-y: auto;
}

.ojc-job-item {
    background: #f9fafb;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
}

.ojc-job-item:hover {
    background: #f3f4f6;
    border-color: #667eea;
}

.ojc-job-info {
    flex: 1;
}

.ojc-job-number {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #374151;
    font-size: 14px;
}

.ojc-job-customer {
    color: #6b7280;
    font-size: 13px;
    margin-top: 3px;
}

.ojc-job-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.ojc-status-processing { background: #fef3c7; color: #92400e; }
.ojc-status-processed { background: #dbeafe; color: #1e40af; }
.ojc-status-in_lab { background: #e0e7ff; color: #3730a3; }
.ojc-status-in_fitting { background: #fce7f3; color: #9d174d; }
.ojc-status-qc { background: #f3e8ff; color: #6b21a8; }
.ojc-status-in_transit { background: #cffafe; color: #0e7490; }
.ojc-status-ready_to_deliver { background: #d1fae5; color: #065f46; }
.ojc-status-delivered { background: #dcfce7; color: #166534; }

.ojc-job-actions {
    display: flex;
    gap: 8px;
}

/* Scanner Section */
.ojc-scanner {
    text-align: center;
    padding: 20px;
}

.ojc-scanner input {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin-bottom: 15px;
}

.ojc-scanner input:focus {
    outline: none;
    border-color: #667eea;
}

.ojc-scan-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    text-align: left;
}

.ojc-scan-result.success {
    background: #f0fdf4;
    border: 2px solid #10b981;
}

.ojc-scan-result.error {
    background: #fef2f2;
    border: 2px solid #ef4444;
}

/* Job Detail Form */
.ojc-job-form {
    display: grid;
    gap: 20px;
}

.ojc-form-section {
    background: #f9fafb;
    padding: 20px;
    border-radius: 10px;
}

.ojc-form-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.ojc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.ojc-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ojc-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.ojc-form-group input,
.ojc-form-group select,
.ojc-form-group textarea {
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ojc-form-group input:focus,
.ojc-form-group select:focus,
.ojc-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Prescription Table */
.ojc-prescription-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.ojc-prescription-table th,
.ojc-prescription-table td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    text-align: center;
    font-size: 13px;
}

.ojc-prescription-table th {
    background: #f3f4f6;
    font-weight: 600;
}

.ojc-prescription-table input {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

/* Balance Display */
.ojc-balance-display {
    text-align: center;
    padding: 20px;
    background: #fffbeb;
    border: 3px solid #f59e0b;
    border-radius: 10px;
    margin-top: 15px;
}

.ojc-balance-label {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.ojc-balance-amount {
    font-size: 32px;
    font-weight: bold;
    color: #dc2626;
    font-family: 'Courier New', monospace;
}

/* Print Button */
.ojc-print-btn {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: white;
}

/* Loading State */
.ojc-loading {
    text-align: center;
    color: #6b7280;
    padding: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .ojc-floating-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 18px;
    }
    
    .ojc-btn-text {
        display: none;
    }
    
    .ojc-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .ojc-tabs {
        flex-wrap: wrap;
    }
    
    .ojc-tab {
        flex: 1;
        min-width: calc(50% - 5px);
        text-align: center;
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .ojc-search-bar {
        flex-direction: column;
    }
    
    .ojc-job-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ojc-job-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Print Styles */
@media print {
    .ojc-floating-btn,
    .ojc-modal,
    .ojc-close-btn,
    .ojc-tabs,
    .ojc-print-btn {
        display: none !important;
    }
}
