/* A-1 Plumbing Customer & Job Management System with Google Maps and Logo */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Header Styles with Logo */
.header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-section {
    flex-shrink: 0;
}

.company-logo {
    height: 80px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.company-logo:hover {
    transform: scale(1.05);
}

.title-section {
    flex: 1;
    min-width: 300px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Form Styles */
.form-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.form-section h2 {
    color: #1e3c72;
    margin-bottom: 25px;
    font-size: 1.8rem;
    border-bottom: 3px solid #2a5298;
    padding-bottom: 10px;
}

.form-group-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #2a5298;
}

.form-group-section h3 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.form-group small {
    margin-top: 5px;
    color: #666;
    font-size: 0.9rem;
}

/* Address Status Styles */
.address-status {
    margin: 15px 0;
    padding: 10px;
    border-radius: 6px;
    font-weight: 500;
}

.address-verified {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.address-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Google Maps Styles */
.map-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.map-section h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.map-section p {
    color: #666;
    margin-bottom: 20px;
}

.map-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    border: 2px solid #ddd;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Map Marker Info Window Styles */
.marker-info {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 250px;
}

.marker-info h4 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.marker-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Quick Actions Styles */
.quick-actions {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.quick-actions h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.quick-actions p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.action-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.action-btn.scheduled {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.action-btn.enroute {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.action-btn.inprogress {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.action-btn.completed {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
}

/* Records Section */
.records-section {
    margin-bottom: 30px;
}

.records-section h2 {
    color: #1e3c72;
    margin-bottom: 25px;
    font-size: 1.8rem;
    border-bottom: 3px solid #2a5298;
    padding-bottom: 10px;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

th {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    vertical-align: top;
}

tr:hover {
    background-color: #f8f9fa;
}

.loading, .no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Address Cell with Map Button */
.address-cell {
    position: relative;
    max-width: 200px;
}

.map-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 5px;
    transition: background-color 0.3s ease;
}

.map-btn:hover {
    background: #1976D2;
}

/* Status and Priority Badges */
.status-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
}

.priority-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

.priority-low {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.priority-normal {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.priority-high {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.priority-emergency {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.edit-btn, .delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.edit-btn {
    background: #FF9800;
    color: white;
}

.edit-btn:hover {
    background: #F57C00;
    transform: translateY(-1px);
}

.delete-btn {
    background: #f44336;
    color: white;
}

.delete-btn:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

/* Notes Cell */
.notes-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status Legend */
.legend-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.legend-section h3 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.status-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #2a5298;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    min-width: 100px;
    text-align: center;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

.status-badge.quote {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.status-badge.scheduled {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.status-badge.enroute {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.status-badge.inprogress {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.status-badge.completed {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.legend-item .description {
    color: #666;
    font-size: 0.9rem;
}

/* System Information */
.system-info {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.system-info h3 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2a5298;
}

.info-item h4 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-item p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.status-indicator {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-indicator.ready {
    background: #d4edda;
    color: #155724;
}

.status-indicator:not(.ready) {
    background: #fff3cd;
    color: #856404;
}

/* Footer with Logo */
.footer {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border-radius: 10px;
    margin-top: 30px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
}

.footer-logo {
    flex-shrink: 0;
}

.footer-logo-img {
    height: 50px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
    opacity: 0.9;
}

.footer-text {
    flex: 1;
    min-width: 300px;
}

.footer-text p {
    margin: 5px 0;
    opacity: 0.9;
}

/* Message Styles */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message-success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.message-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.message-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .company-logo {
        height: 60px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .map-container {
        height: 300px;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 8px 6px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .status-legend {
        grid-template-columns: 1fr;
    }
    
    .legend-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-logo-img {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .company-logo {
        height: 50px;
    }
    
    .form-section,
    .map-section,
    .quick-actions,
    .legend-section,
    .system-info {
        padding: 20px;
    }
    
    .map-container {
        height: 250px;
    }
    
    .message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Print Styles */
@media print {
    .quick-actions,
    .action-buttons,
    .edit-btn,
    .delete-btn,
    .map-btn {
        display: none;
    }
    
    .container {
        box-shadow: none;
        margin: 0;
    }
    
    .map-container {
        height: 200px;
        border: 1px solid #ccc;
    }
    
    .company-logo,
    .footer-logo-img {
        filter: none;
    }
}

/* Logo Loading States */
.company-logo,
.footer-logo-img {
    transition: opacity 0.3s ease;
}

.company-logo:not([src]),
.footer-logo-img:not([src]) {
    opacity: 0;
}

/* Fallback for missing logo */
.logo-section:has(.company-logo[alt]:not([src])):before,
.footer-logo:has(.footer-logo-img[alt]:not([src])):before {
    content: "🔧 A-1";
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

