:root {
    --primary-color: #007bff; /* A nice, standard blue */
    --secondary-color: #f8f9fa;
    --dark-color: #343a40;
    --light-color: #ffffff;
    --success-color: #198754; /* A slightly darker green */
    --accent-color: #ff9800; /* Orange for highlights */
    --font-family: 'Cairo', sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--secondary-color);
    color: var(--dark-color);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* Header */
header {
    background-color: var(--light-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-left: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin: 0;
}

.nav-links a {
    color: var(--dark-color);
    margin: 0 15px;
    font-weight: 400;
    transition: color 0.3s ease;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.login-btn, .track-btn {
    background-color: var(--primary-color);
    color: var(--light-color) !important;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    border-bottom: none !important;
}

.track-btn {
    background-color: var(--success-color);
}

.login-btn:hover {
    background-color: #0056b3;
}
.track-btn:hover {
    background-color: #13653f;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}
.notification-icon {
    position: relative;
    cursor: pointer;
    color: var(--dark-color);
}
.notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    width: 10px;
    height: 10px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid var(--light-color);
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 8px;
}

/* Hero Section */
.hero {
    background: url('hero-bg.png') no-repeat center center/cover;
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--light-color);
    position: relative;
    padding: 0 5%;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.cta-button {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-family: var(--font-family);
    font-weight: 700;
}

.cta-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Sections */
section {
    padding: 60px 5%;
    text-align: center;
}

section h3 {
    font-size: 2rem;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

section h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Services Section */
.services-section {
    background-color: var(--light-color);
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.service-card.selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 8px 16px rgba(0, 123, 255, 0.2);
}

.service-card img {
    height: 60px;
    margin-bottom: 15px;
}

.service-card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.service-card p {
    font-size: 0.9rem;
    color: #6c757d;
}

/* How It Works Section */
.steps {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    text-align: center;
}

.step {
    flex: 1;
    max-width: 300px;
}

.step span {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--light-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.step h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* Testimonials Section */
.testimonials-section {
    background-color: var(--light-color);
}

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

.testimonial-card {
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.testimonial-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid var(--light-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.testimonial-text {
    font-style: italic;
    color: #555;
    margin-bottom: 15px;
    flex-grow: 1;
}

.testimonial-author {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stars {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 20px 5%;
}
footer p {
    margin: 5px 0;
}
footer a {
    color: var(--light-color);
    text-decoration: underline;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--light-color);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 15px; 
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.modal-header p {
    color: #6c757d;
}

/* Form Styles */
#order-form {
    display: flex;
    flex-direction: column;
}
.form-step {
    display: none;
}
.form-step.active {
    display: block;
}

.form-step h4 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

#order-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    text-align: right;
}

#order-form select,
#order-form input[type="text"],
#order-form input[type="date"],
#order-form input[type="time"],
#order-form input[type="tel"],
#order-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 15px;
    box-sizing: border-box;
    font-family: var(--font-family);
}

#map {
    height: 250px;
    width: 100%;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
}

.modal-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.modal-navigation button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 700;
    transition: background-color 0.3s ease;
}
.prev-btn {
    background-color: #6c757d;
    color: white;
}
.next-btn, .submit-btn {
    background-color: var(--primary-color);
    color: white;
}
.next-btn:hover, .submit-btn:hover {
    background-color: #0056b3;
}
.prev-btn:hover {
    background-color: #5a6268;
}

.confirmation-view {
    text-align: center;
    padding: 20px;
    background-color: #e9f5ff;
    border: 1px dashed var(--primary-color);
    border-radius: 8px;
}
.confirmation-view h4 {
    border: none;
    color: var(--success-color);
}
.summary {
    text-align: right;
    margin: 20px auto;
    max-width: 400px;
}
.summary p {
    margin: 8px 0;
    font-size: 1.1rem;
}
.note {
    font-size: 0.9rem;
    color: #6c757d;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin-top: 10px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, bottom 0.3s, visibility 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    bottom: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
    }
    .nav-links {
        margin-top: 15px;
    }
    .nav-links a {
        margin: 0 8px;
        display: inline-block;
        padding: 5px 0;
    }
    .hero {
        height: 50vh;
    }
    .hero h2 {
        font-size: 1.8rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .steps {
        flex-direction: column;
    }
}

/* --- New Styles for Login/Admin Pages --- */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: url('admin-bg.png') no-repeat center center/cover;
    padding: 20px;
}

.auth-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.auth-logo {
    margin-bottom: 20px;
}

.auth-logo img {
    height: 60px;
}

.auth-box h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.auth-form .input-group {
    margin-bottom: 20px;
    text-align: right;
}

.auth-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-family: var(--font-family);
}

.auth-button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-button:hover {
    background-color: #0056b3;
}

.auth-footer {
    margin-top: 20px;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: underline;
}

#error-message, #success-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    display: none;
}
#success-message {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

/* Admin Dashboard */
.admin-header {
    background-color: var(--dark-color);
    color: white;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header .logo {
    color: white;
}
.admin-header .logo h1 {
    color: white;
}
.admin-header a {
    color: white;
}
.admin-header #logout-btn {
    background: #dc3545;
    padding: 8px 15px;
    border-radius: 5px;
}

.dashboard {
    padding: 40px 5%;
}

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

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

.dashboard-card {
    background: var(--light-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.dashboard-card h3 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.dashboard-card ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.dashboard-card li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dashboard-card li:last-child {
    border-bottom: none;
}
.dashboard-card li .actions button {
    margin: 0 5px;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    color: white;
}
.approve-btn, .chat-btn {
    background-color: var(--primary-color);
}
.reject-btn, .complete-btn {
     background-color: #dc3545;
}
.complete-btn {
    background-color: var(--success-color);
}
.status-active {
    color: var(--success-color);
    font-weight: bold;
}
.status-pending {
    color: var(--accent-color);
    font-weight: bold;
}
.password-change-form input {
     width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-family: var(--font-family);
    margin-bottom: 10px;
}

.dashboard-card li a {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    font-size: 0.9rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.dashboard-card li a:hover {
    background-color: #0056b3;
}

/* New Chat styles */
.chat-modal-content {
    display: flex;
    flex-direction: column;
    height: 80vh;
    max-height: 600px;
}
.close-chat-btn, .close-chat-viewer-btn {
     position: absolute;
    top: 15px;
    left: 15px; 
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
}

.chat-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    background-color: var(--secondary-color);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-form {
    display: flex;
    margin-top: 15px;
}

.chat-form input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 0 5px 5px 0;
    font-family: var(--font-family);
}
.chat-form button {
    padding: 0 25px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    border-radius: 5px 0 0 5px;
    font-family: var(--font-family);
    font-weight: 700;
}
.chat-list-item {
    cursor: pointer;
}
.chat-list-item:hover {
    background-color: #f8f9fa;
}
.unread-badge {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.8em;
    font-weight: bold;
}
.chat-notice {
    text-align: center;
    color: #6c757d;
    margin: auto;
}
.message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 75%;
    display: flex;
    flex-direction: column;
}
.message p {
    margin: 0 0 4px 0;
    line-height: 1.4;
}
.message .timestamp {
    font-size: 0.75rem;
    color: #6c757d;
}
.message-customer {
    background-color: #e9ecef;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}
.message-customer .timestamp {
    align-self: flex-start;
}
.message-technician {
    background-color: #d1e7ff;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}
.message-technician .timestamp {
    align-self: flex-end;
}

/* Tracking Page styles */
.track-container {
    padding: 60px 5%;
    text-align: center;
    min-height: 60vh;
}
#order-info {
    max-width: 700px;
    margin: 0 auto;
}
#order-details {
    background: var(--light-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: right;
    border: 1px solid #eee;
}
#order-status {
    font-size: 1.5rem;
    margin-bottom: 20px;
}
.status-pending { 
    color: var(--accent-color); 
}
.status-accepted { 
    color: var(--primary-color); 
}
.status-completed { 
    color: var(--success-color); 
}