/* Global Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Prevent any element from causing horizontal scroll */
img, video, iframe, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Fix for tables on mobile */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Fix for forms on mobile */
input, select, textarea, button {
    max-width: 100%;
}

/* Fix for modals and dropdowns */
.modal, .dropdown, .popup {
    max-width: 100%;
    overflow-x: hidden;
}

/* Container fixes */
.container, .wrapper, .main-content {
    width: 100%;
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .container, .wrapper, .main-content {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 480px) {
    .container, .wrapper, .main-content {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Utility to hide scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Force no horizontal scroll on all elements */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Prevent overflow on all containers */
div, section, article, aside, header, footer, nav, main {
    overflow-x: hidden;
    max-width: 100%;
}

/* Fix for grid and flex layouts */
.flex-container,
.grid-container {
    max-width: 100%;
    overflow: hidden;
}

/* Word wrap for long text */
.word-wrap {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Admin Styles */
.admin-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.admin-sidebar {
    width: 250px;
    background: #1a1a2e;
    padding: 20px 0;
    min-height: 100vh;
}

.admin-sidebar ul {
    list-style: none;
    padding: 0;
}

.admin-sidebar ul li {
    padding: 0;
}

.admin-sidebar ul li a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 3px solid #e94560;
}

.admin-sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
}

.admin-content {
    flex: 1;
    padding: 20px;
    background: #f5f5f5;
}

/* Alert styles */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert i {
    font-size: 18px;
}

/* Password wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
}

.toggle-password:hover {
    color: #333;
}

/* Form text */
.form-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Remember me checkbox */
.remember-me {
    display: flex;
    align-items: center;
}

.remember-me label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.terms {
    margin: 20px 0;
}

.terms label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.terms a {
    color: #e94560;
    text-decoration: none;
}

.terms a:hover {
    text-decoration: underline;
}

/* Error messages */
.error-message {
    color: #c62828;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

input.error {
    border-color: #c62828 !important;
}

input.success {
    border-color: #2e7d32 !important;
}
/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: #e94560;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 24px;
    margin: 0;
    color: #1a1a2e;
}

.stat-info p {
    margin: 5px 0 0;
    color: #666;
}

/* Admin Table */
.admin-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-table thead {
    background: #1a1a2e;
    color: white;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
}

.admin-table tbody tr {
    border-bottom: 1px solid #eee;
}

.admin-table tbody tr:hover {
    background: #f9f9f9;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-badge.active,
.status-badge.completed,
.status-badge.paid {
    background: #4CAF50;
    color: white;
}

.status-badge.pending {
    background: #ff9800;
    color: white;
}

.status-badge.cancelled,
.status-badge.failed {
    background: #f44336;
    color: white;
}

/* Customer Styles */
.customer-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.customer-sidebar {
    width: 250px;
    background: #1a1a2e;
    padding: 20px 0;
    min-height: 100vh;
}

.customer-sidebar ul {
    list-style: none;
    padding: 0;
}

.customer-sidebar ul li a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.customer-sidebar ul li a:hover,
.customer-sidebar ul li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 3px solid #e94560;
}

.customer-sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
}

.customer-content {
    flex: 1;
    padding: 20px;
    background: #f5f5f5;
}

/* Purchase Grid */
.purchase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.purchase-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.purchase-card h3 {
    margin: 0 0 5px;
    color: #1a1a2e;
}

.purchase-card .car-name {
    color: #666;
    margin: 0 0 10px;
}

.purchase-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
}

.purchase-details .price {
    font-size: 18px;
    font-weight: bold;
    color: #e94560;
}

.purchase-details .date {
    color: #666;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .admin-sidebar,
    .customer-sidebar {
        display: none;
    }
    
    .admin-container,
    .customer-container {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .admin-table {
        font-size: 14px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .purchase-grid {
        grid-template-columns: 1fr;
    }
}

/* Contact and About Pages */
.page-content {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-content h1 {
    color: #1a1a2e;
    margin-bottom: 20px;
}

.page-content .contact-info {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.contact-info .info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.contact-info .info-item i {
    font-size: 24px;
    color: #e94560;
    width: 40px;
}

.contact-form {
    margin-top: 30px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    min-height: 100px;
}

.contact-form textarea:focus {
    outline: none;
    border-color: #e94560;
}

/* About Page */
.about-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.about-content h2 {
    color: #1a1a2e;
    margin-top: 20px;
}

.about-content ul {
    padding-left: 20px;
}

.about-content ul li {
    margin-bottom: 10px;
}