/* Mobile Admin Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

/* Login Screen */
.mobile-login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

#mobileLoginForm {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#mobileLoginForm input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.btn-primary:active {
    background: #5568d3;
}

.error-msg {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
    display: none;
}

.error-msg.show {
    display: block;
}

/* Mobile Header */
.mobile-header {
    background: #667eea;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-header h1 {
    font-size: 1.5em;
}

.header-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
}

/* Mobile Navigation - App Style */
.mobile-nav {
    display: flex;
    background: #f5f5f5;
    padding: 10px;
    gap: 10px;
    position: sticky;
    top: 60px;
    z-index: 99;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-btn {
    flex: 1;
    padding: 18px 10px;
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* Mobile Tabs */
.mobile-tab {
    display: none;
    padding: 15px;
}

.mobile-tab.active {
    display: block;
}

/* Jobs List - App Style */
.jobs-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
}

.job-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid #f0f0f0;
    transition: transform 0.2s;
}

.job-card:active {
    transform: scale(0.98);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.job-time {
    font-weight: bold;
    color: #667eea;
    font-size: 22px;
}

.job-status {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.job-status.pending {
    background: #fff3cd;
    color: #ff9800;
}

.job-status.active {
    background: #d4edda;
    color: #28a745;
}

.job-status.completed {
    background: #e2e3e5;
    color: #6c757d;
}

.job-customer {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.job-address {
    color: #666;
    font-size: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.job-address::before {
    content: '📍';
    margin-right: 5px;
}

.job-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.btn-start {
    flex: 1;
    padding: 16px;
    background: linear-gradient(135deg, #00b894 0%, #00d2a0 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
    transition: transform 0.2s;
}

.btn-start:active {
    transform: scale(0.95);
}

.btn-view-map {
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s;
}

.btn-view-map:active {
    transform: scale(0.95);
}

/* Job Main Actions */
.job-main-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

.btn-action-large {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 25px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-action-large:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.action-icon {
    font-size: 36px;
}

.action-text {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    display: block;
}

.action-desc {
    font-size: 14px;
    color: #666;
    display: block;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-bottom: 2px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.section-header h3 {
    font-size: 18px;
    color: #333;
}

.btn-back {
    padding: 10px 18px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    color: #667eea;
    transition: all 0.2s;
}

.btn-back:active {
    transform: scale(0.95);
    background: #e0e0e0;
}

/* Customer Search Section */
.customer-search-section {
    padding: 20px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
}

.btn-search {
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-search:active {
    transform: scale(0.95);
}

.or-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.or-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e0e0e0;
}

.or-divider span {
    background: #f5f5f5;
    padding: 0 15px;
    position: relative;
    color: #999;
    font-weight: 600;
}

#customerSearchResults {
    margin-top: 15px;
}

.customer-result {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.customer-result:active {
    transform: scale(0.98);
    border-color: #667eea;
}

.customer-result-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.customer-result-info {
    font-size: 14px;
    color: #666;
}

#addNewCustomerForm input,
#addNewCustomerForm textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
}

#addNewCustomerForm h4 {
    margin-bottom: 15px;
    color: #333;
}

.btn-secondary {
    padding: 12px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 8px;
}

/* Active Job Panel */
.active-job {
    background: white;
    min-height: 100vh;
}

.job-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.job-header h3 {
    font-size: 1.1em;
    flex: 1;
    text-align: center;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-header .btn-back {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    min-width: 70px;
}

.job-header .btn-back:active {
    background: rgba(255,255,255,0.3);
}

.btn-complete {
    background: white;
    color: #667eea;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    min-width: 90px;
}

.btn-complete:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.job-section {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.job-section h4 {
    margin-bottom: 15px;
    color: #667eea;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

#customerInfo {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#customerInfo input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

/* System Type Buttons */
.system-type-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.btn-system {
    padding: 20px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.btn-system.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Photo Sections */
.photo-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.photo-section h5 {
    margin-bottom: 10px;
    color: #333;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #e0e0e0;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
}

.btn-add-photo {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 10px;
}

.btn-save {
    width: 100%;
    padding: 18px;
    background: #00b894;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    margin: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 15px;
    margin: 20px;
}

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

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

/* Photo Capture */
.photo-capture-body {
    padding: 20px;
}

#cameraPreview {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
    background: #000;
}

#capturedPhoto {
    width: 100%;
    border-radius: 8px;
}

.camera-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.btn-capture {
    padding: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
}

/* Inventory */
.inventory-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.inventory-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.inventory-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.inventory-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f0f0f0;
}

.inventory-item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.inventory-item-cost {
    color: #00b894;
    font-weight: bold;
}

/* Ada Chat */
.ada-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
}

.ada-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: white;
}

.ada-message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 12px;
    max-width: 80%;
}

.ada-message.user {
    background: #667eea;
    color: white;
    margin-left: auto;
}

.ada-message.bot {
    background: #f0f0f0;
    color: #333;
}

.ada-input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.btn-camera {
    padding: 12px;
    background: #e0e0e0;
    border: none;
    border-radius: 8px;
    font-size: 20px;
}

#adaInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.btn-send {
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
}

/* Form Container */
.form-container {
    padding: 20px;
}

.form-container input,
.form-container textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.photo-upload {
    margin: 15px 0;
}

.photo-upload label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.photo-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
}

/* Map View */
.map-container {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (min-width: 768px) {
    .mobile-nav {
        top: 70px;
    }

    .system-type-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}
