/* 3 Kings Laundry CSS Styles */

/* CSS Variables for Light/Dark Mode */
:root {
    --primary-color: #667eea;
    --primary-hover: #5a6fd8;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Light theme colors */
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #dddddd;
    --input-bg: #ffffff;
    --input-border: #dddddd;
    --table-hover: #f8f9fa;
    --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --footer-bg: #2c3e50;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-color: #404040;
    --input-bg: #404040;
    --input-border: #555555;
    --table-hover: #3a3a3a;
    --header-bg: linear-gradient(135deg, #4a5568 0%, #553c9a 100%);
    --footer-bg: #1a202c;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-strong: rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: var(--header-bg);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    font-size: 0.9rem;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
    border: none;
    cursor: pointer;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.35);
    text-decoration: none;
    color: white;
}

/* Dark Mode Toggle */
.theme-toggle {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.25) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.375rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.35) 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Footer */
.footer {
    background-color: var(--footer-bg);
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Login Page Styles */
.login-body {
    background: var(--header-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px var(--shadow-strong);
    transition: background-color 0.3s ease;
}

.login-box .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-box .logo h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-box .logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--table-hover);
    border-radius: 5px;
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
}

.login-info code {
    background-color: var(--border-color);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
    transition: background-color 0.3s ease;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s, background-color 0.3s;
    background-color: var(--input-bg);
    color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

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

/* Enhanced Button Styles */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.25);
    transform: translateY(0);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    text-decoration: none;
    color: white;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.25);
}

.btn-full {
    width: 100%;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #5a6268 100%);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
    color: #212529;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #138496 100%);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
}

/* Outline button variants */
.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.2);
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

/* Icon buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon-only {
    padding: 0.75rem;
    border-radius: 50%;
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Floating Action Button */
.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    z-index: 1000;
}

.btn-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

/* Alert Styles */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

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

[data-theme="dark"] .alert-success {
    background-color: #155724;
    color: #d4edda;
    border: 1px solid #1e7e34;
}

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

[data-theme="dark"] .alert-error {
    background-color: #721c24;
    color: #f8d7da;
    border: 1px solid #a94442;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

[data-theme="dark"] .alert-warning {
    background-color: #856404;
    color: #fff3cd;
    border: 1px solid #b7950b;
}

.alert-info {
    background-color: #cce8f4;
    color: #055160;
    border: 1px solid #9ec5d6;
}

[data-theme="dark"] .alert-info {
    background-color: #055160;
    color: #cce8f4;
    border: 1px solid #138496;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 2rem;
    transition: background-color 0.3s ease;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.card-body {
    padding: 1.5rem;
}

/* Dashboard Styles */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    text-align: center;
    transition: background-color 0.3s ease;
}

.stat-card h3 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

.stat-card.income {
    border-left: 5px solid var(--success-color);
}

.stat-card.orders {
    border-left: 5px solid var(--primary-color);
}

.stat-card.pending {
    border-left: 5px solid var(--warning-color);
}

.stat-card.completed {
    border-left: 5px solid var(--success-color);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin: 1rem 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow);
    transition: background-color 0.3s ease;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.table th {
    background-color: var(--table-hover);
    font-weight: 600;
    transition: background-color 0.3s ease;
}

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

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-received {
    background-color: #cce8f4;
    color: #055160;
}

[data-theme="dark"] .status-received {
    background-color: #0c5460;
    color: #cce8f4;
}

.status-washing {
    background-color: #fff3cd;
    color: #856404;
}

[data-theme="dark"] .status-washing {
    background-color: #856404;
    color: #fff3cd;
}

.status-ready {
    background-color: #d1ecf1;
    color: #0c5460;
}

[data-theme="dark"] .status-ready {
    background-color: #0c5460;
    color: #d1ecf1;
}

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

[data-theme="dark"] .status-claimed {
    background-color: #155724;
    color: #d4edda;
}

.payment-paid {
    background-color: #d4edda;
    color: #155724;
}

[data-theme="dark"] .payment-paid {
    background-color: #155724;
    color: #d4edda;
}

.payment-unpaid {
    background-color: #f8d7da;
    color: #721c24;
}

[data-theme="dark"] .payment-unpaid {
    background-color: #721c24;
    color: #f8d7da;
}

/* Search and Filter */
.search-filter {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 2rem;
    transition: background-color 0.3s ease;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

/* Inline actions alignment for search form */
.search-row .actions-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding-top: 1.61rem; /* approximate label height to align with inputs */
}
.actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.actions-inline .btn { margin: 0; }

/* Form actions alignment */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0 1.5rem;
}
.form-actions .btn { margin: 0; }
@media (max-width: 500px) {
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
}
.search-row .actions-group label { display: none; }

/* Accessibility helper */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

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

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

.modal-content {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .user-menu {
        order: 2;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .search-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-actions {
        justify-content: center;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem;
    }
    
    /* Enhanced button responsiveness */
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
        min-height: 48px; /* Touch-friendly minimum */
        border-radius: 10px;
    }
    
    .btn-sm {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .login-container {
        padding: 15px;
    }
    
    .login-box {
        padding: 1.5rem;
    }
    
    /* Mobile button adjustments */
    .btn {
        font-size: 0.9rem;
        padding: 1rem 1rem;
        border-radius: 12px;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }
    
    .theme-toggle {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .logout-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-link {
        text-align: center;
        padding: 0.75rem 1rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .page-actions,
    .search-filter {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
    }
}

/* Utility Classes for Dark Mode Compatibility */
.text-default {
    color: var(--text-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-info {
    color: var(--info-color);
}

/* Order Sections Grid Layout */
.order-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Responsive - stack on mobile */
@media (max-width: 768px) {
    .order-sections-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Autocomplete Suggestions (Orders Search) */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: 50;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 4px 12px var(--shadow);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.suggestion-item {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.suggestion-item:hover {
    background: var(--table-hover);
}
.suggestion-item:last-child { border-bottom: none; }

/* Scrollable table wrapper (activated when >5 rows) */
.table-scroll {
    max-height: 420px;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.table-scroll table {
    margin: 0;
}
.table-scroll thead th {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 5;
    box-shadow: 0 2px 2px rgba(0,0,0,0.05);
}
@media (max-width: 600px) {
    .table-scroll { max-height: 360px; }
}