/* LaundryClean Pro - Enhanced Responsive Design */

/* ===== CSS VARIABLES ===== */
:root {
    --primary-black: #000000;
    --secondary-black: #1a1a1a;
    --dark-gray: #333333;
    --medium-gray: #666666;
    --light-gray: #999999;
    --extra-light-gray: #e5e5e5;
    --white: #ffffff;
    --off-white: #f8f8f8;
    --success: #00c853;
    --warning: #ff9800;
    --error: #f44336;
    --info: #2196f3;
    
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    --max-mobile-width: 500px;
    --max-desktop-width: 1200px;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    color: var(--dark-gray);
    background-color: var(--off-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== RESPONSIVE CONTAINER ===== */
.app-container {
    max-width: var(--max-mobile-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--white);
    position: relative;
}

/* Desktop Layout */
@media (min-width: 768px) {
    body {
        background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
        padding: 20px;
    }
    
    .app-container {
        max-width: var(--max-desktop-width);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.15);
        border-radius: var(--border-radius-lg);
        display: grid;
        grid-template-columns: 250px 1fr;
        min-height: calc(100vh - 40px);
    }
    
    .sidebar {
        background: var(--primary-black);
        color: var(--white);
        padding: 24px;
        border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg);
        display: block !important;
    }
    
    .main-content {
        padding: 24px;
        overflow-y: auto;
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    .mobile-only {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .desktop-only, .sidebar {
        display: none !important;
    }
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-black);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }

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

a:hover { opacity: 0.8; }

/* ===== HEADER / TOP BAR ===== */
.top-bar {
    background: var(--white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--extra-light-gray);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn, .menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--off-white);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.back-btn:hover, .menu-btn:hover {
    background: var(--extra-light-gray);
    transform: scale(1.05);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-black);
}

/* ===== SIDEBAR (Desktop) ===== */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar-logo h2 {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-nav i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 14px 24px;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-black);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--secondary-black);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-black);
    border: 2px solid var(--primary-black);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-black);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--dark-gray);
    border: 1px solid var(--extra-light-gray);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary-black);
    color: var(--primary-black);
}

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

.btn-danger {
    background: var(--error);
    color: var(--white);
}

.btn-block { width: 100%; display: flex; }
.btn-lg { padding: 18px 32px; font-size: 1.125rem; }
.btn-sm { padding: 10px 16px; font-size: 0.875rem; }

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--extra-light-gray);
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-control::placeholder {
    color: var(--light-gray);
}

.form-control.error {
    border-color: var(--error);
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 4px;
    display: block;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23333' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.input-icon {
    position: relative;
}

.input-icon input {
    padding-left: 45px;
}

.input-icon .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--medium-gray);
    pointer-events: none;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--extra-light-gray);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-black);
    margin: 0;
}

.card-body {
    color: var(--medium-gray);
}

/* ===== SERVICE CARDS ===== */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
}

@media (min-width: 768px) {
    .service-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.service-card {
    background: var(--white);
    border: 2px solid var(--extra-light-gray);
    border-radius: var(--border-radius-lg);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    border-color: var(--medium-gray);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.service-card.active {
    border-color: var(--primary-black);
    background: var(--primary-black);
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.service-card.active .service-icon {
    color: var(--white);
}

.service-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1rem;
}

.service-price {
    font-size: 0.875rem;
    color: var(--medium-gray);
}

.service-card.active .service-price {
    color: var(--extra-light-gray);
}

/* ===== ORDER STATUS TIMELINE ===== */
.status-timeline {
    padding: 24px;
}

.status-step {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding-bottom: 32px;
}

.status-step:last-child {
    padding-bottom: 0;
}

.status-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 40px;
    width: 2px;
    height: calc(100% - 40px);
    background: var(--extra-light-gray);
}

.status-step.completed:not(:last-child)::after {
    background: var(--primary-black);
}

.status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--extra-light-gray);
    border: 3px solid var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.status-step.completed .status-icon {
    background: var(--primary-black);
    color: var(--white);
}

.status-step.active .status-icon {
    background: var(--primary-black);
    color: var(--white);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
}

.status-content {
    flex: 1;
}

.status-title {
    font-weight: 600;
    color: var(--primary-black);
    margin-bottom: 4px;
}

.status-time {
    font-size: 0.875rem;
    color: var(--medium-gray);
}

/* ===== BOTTOM NAVIGATION (Mobile) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-mobile-width);
    background: var(--white);
    border-top: 1px solid var(--extra-light-gray);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    color: var(--medium-gray);
    text-decoration: none;
    transition: var(--transition-fast);
}

.nav-item.active {
    color: var(--primary-black);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== CONTENT WRAPPER ===== */
.content-wrapper {
    padding-bottom: 80px;
}

@media (min-width: 768px) {
    .content-wrapper {
        padding-bottom: 0;
    }
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background: var(--light-gray); color: var(--white); }
.badge-accepted { background: var(--info); color: var(--white); }
.badge-collected { background: var(--warning); color: var(--white); }
.badge-in_progress { background: var(--warning); color: var(--white); }
.badge-completed { background: var(--success); color: var(--white); }
.badge-delivered { background: var(--success); color: var(--white); }
.badge-cancelled { background: var(--error); color: var(--white); }

/* ===== ALERTS ===== */
.alert {
    padding: 16px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

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

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid var(--error);
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid var(--info);
}

.alert-warning {
    background: #fff3e0;
    color: #ef6c00;
    border-left: 4px solid var(--warning);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--extra-light-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--extra-light-gray);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--medium-gray);
    transition: var(--transition-fast);
}

.close-modal:hover {
    color: var(--primary-black);
}

/* ===== LOADER ===== */
.loader {
    border: 3px solid var(--extra-light-gray);
    border-top: 3px solid var(--primary-black);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.flex-column { flex-direction: column; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.text-primary { color: var(--primary-black); }
.text-muted { color: var(--medium-gray); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-normal { font-weight: 400; }

.hidden { display: none !important; }

/* ===== RESPONSIVE GRID ===== */
.grid {
    display: grid;
    gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 767px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--extra-light-gray);
}

.table th {
    background: var(--off-white);
    font-weight: 600;
    color: var(--primary-black);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: var(--off-white);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--off-white);
}

::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

/* ===== PRINT STYLES ===== */
@media print {
    .top-bar, .bottom-nav, .sidebar, .btn, .no-print {
        display: none !important;
    }
    
    .app-container {
        box-shadow: none;
        max-width: 100%;
    }
}
