/* Admin Panel Styles for Wooden Spoon Bakery */

/* Touch Screen Optimizations */
* {
    -webkit-tap-highlight-color: rgba(156, 28, 52, 0.2);
    touch-action: manipulation;
}

/* Admin Container */
.admin-container {
    min-height: 100vh;
    background-color: #f8f9fa;
    font-family: 'Open Sans', sans-serif;
}

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #9c1c34 0%, #bfa14a 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.admin-nav ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-nav a:hover,
.admin-nav a.active {
    background-color: rgba(255,255,255,0.2);
}

.admin-nav a:active {
    background-color: rgba(255,255,255,0.3);
}

/* Admin Main Content */
.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    margin: 0 0 1rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #9c1c34;
    margin: 0;
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.quick-actions h2 {
    margin: 0 0 1rem 0;
    color: #2d2d2d;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.action-buttons .btn {
    min-height: 44px;
    min-width: 44px;
}

/* Buttons */
.btn {
    display: inline-flex;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.95rem;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

.btn-primary {
    background-color: #9c1c34;
    color: white;
}

.btn-primary:hover {
    background-color: #7a1628;
    transform: translateY(-2px);
}

.btn-primary:active {
    background-color: #5d111e;
    transform: translateY(0);
}

.btn-secondary {
    background-color: #bfa14a;
    color: white;
}

.btn-secondary:hover {
    background-color: #a8903f;
    transform: translateY(-2px);
}

.btn-secondary:active {
    background-color: #8f7a35;
    transform: translateY(0);
}

.btn-outline {
    background-color: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.btn-outline:hover {
    background-color: #6c757d;
    color: white;
}

.btn-outline:active {
    background-color: #5a6268;
    transform: translateY(0);
}

.btn-small {
    padding: 0.625rem 1.25rem;
    font-size: 0.85rem;
    min-height: 44px;
}

/* Sections */
.recent-activity,
.system-status,
.orders-section,
.settings-section,
.filter-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.recent-activity h2,
.system-status h2,
.orders-section h2,
.settings-section h2,
.filter-controls h2 {
    margin: 0 0 1rem 0;
    color: #2d2d2d;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 0.5rem;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.status-label {
    font-weight: 500;
    color: #6c757d;
}

.status-value {
    font-weight: 600;
}

.status-ok {
    color: #28a745;
}

.status-error {
    color: #dc3545;
}

.status-warning {
    color: #ffc107;
}

/* Orders Table */
.orders-table-container {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.orders-table th,
.orders-table td {
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    min-height: 44px;
}

.orders-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.orders-table tr {
    transition: background-color 0.2s ease;
}

.orders-table tr:hover {
    background-color: #f8f9fa;
}

.orders-table tr:active {
    background-color: #e9ecef;
}

/* Make table rows clickable/touch-friendly */
.orders-table tbody tr {
    cursor: pointer;
}

/* Status Badges */
.status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
    min-height: 28px;
    line-height: 1.4;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Forms */
.settings-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d2d2d;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-height: 44px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #9c1c34;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    margin-top: 0.25rem;
    cursor: pointer;
}

.checkbox-group small {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin: 0 0 1rem 0;
    color: #2d2d2d;
}

/* Filter Controls */
.filter-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-buttons a,
.filter-buttons button {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

/* No Orders */
.no-orders {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

/* Admin Footer */
.admin-footer {
    background: #2d2d2d;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

.admin-footer p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-header {
        padding: 1rem;
    }
    
    .admin-nav ul {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .admin-nav a {
        width: 100%;
        justify-content: flex-start;
    }
    
    .admin-main {
        padding: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .status-item {
        min-height: 48px;
        padding: 1rem;
    }
    
    .orders-table-container {
        font-size: 0.9rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 1rem 0.5rem;
        min-height: 48px;
    }
    
    .filter-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-buttons a,
    .filter-buttons button {
        width: 100%;
        min-height: 48px;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
        padding: 1.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions .btn {
        min-height: 48px;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .quick-actions,
    .recent-activity,
    .system-status,
    .orders-section,
    .settings-section,
    .filter-controls {
        padding: 1.25rem;
    }
}
