/* admin.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
}

.form-section, .search-section, .table-section {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-section h2, .search-section h2, .table-section h2 {
    color: #ff6b9d;
    margin-bottom: 20px;
    font-size: 1.8rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff6b9d;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

button {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 10px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

#cancelBtn {
    background: linear-gradient(135deg, #ff9ff3 0%, #f368e0 100%);
}

.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #ff6b9d;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: #fef7f7;
}

.status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

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

.status.delivered {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status.cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.edit-btn {
    background: linear-gradient(135deg, #ff9ff3 0%, #f368e0 100%);
    padding: 8px 15px;
    font-size: 14px;
}

.delete-btn {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    padding: 8px 15px;
    font-size: 14px;
}

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

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b9d;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading p {
    color: white;
    font-size: 18px;
}

.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    font-weight: 600;
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.message.show {
    transform: translateX(0);
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .form-section, .search-section, .table-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .form-section h2, .search-section h2, .table-section h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    button {
        padding: 12px 20px;
        font-size: 14px;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .search-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-bar input {
        width: 100%;
        margin-bottom: 0;
    }
    
    .search-bar button {
        width: 100%;
    }
    
    /* Table keeps desktop size - only container scrolls */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Table with slightly smaller font for mobile */
    table {
        font-size: 14px; /* Slightly smaller than desktop */
        width: 100%;
        min-width: 800px; /* Ensure minimum width for readability */
    }
    
    th, td {
        padding: 12px; /* Slightly reduced padding */
        white-space: nowrap; /* Prevent text wrapping */
    }
    
    th {
        font-size: 14px; /* Slightly smaller header font */
    }
    
    /* Action buttons keep desktop size */
    .action-buttons {
        display: flex;
        gap: 5px;
        flex-direction: row; /* Keep horizontal layout */
    }
    
    .edit-btn, .delete-btn {
        padding: 6px 12px; /* Slightly smaller padding */
        font-size: 12px; /* Smaller font size */
        margin: 0;
        white-space: nowrap;
    }
    
    .status {
        font-size: 11px; /* Smaller status font */
        padding: 4px 10px; /* Smaller status padding */
    }

    #ordersTable td {
        text-transform: uppercase;
    }

    /* Or if you want to target specific columns only */
    #ordersTable td:nth-child(1), /* Customer Name */
    #ordersTable td:nth-child(2), /* Order Name */
    #ordersTable td:nth-child(4)  /* Status */
    {
        text-transform: uppercase;
    }
    
    /* Message positioning for mobile */
    .message {
        position: fixed;
        top: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .message.show {
        transform: translateY(0);
    }
    
    /* Loading spinner for mobile */
    .loading {
        padding: 20px;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
        margin-bottom: 15px;
    }
    
    .loading p {
        font-size: 16px;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .form-section, .search-section, .table-section {
        padding: 10px;
        border-radius: 5px;
    }
    
    .form-section h2, .search-section h2, .table-section h2 {
        font-size: 1.2rem;
    }
    
    /* Table with even smaller font for extra small devices */
    table {
        font-size: 13px; /* Even smaller for very small screens */
        min-width: 800px;
    }
    
    th, td {
        padding: 10px; /* More compact padding */
    }
    
    .edit-btn, .delete-btn {
        font-size: 11px; /* Smaller button text */
        padding: 5px 10px; /* More compact button padding */
    }
    
    .status {
        font-size: 10px; /* Smaller status font */
        padding: 3px 8px; /* More compact status padding */
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    .form-section, .search-section, .table-section {
        padding: 15px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    button {
        min-height: 44px; /* iOS recommended touch target size */
    }
    
    .form-group input,
    .form-group select {
        min-height: 44px;
    }
    
    .edit-btn, .delete-btn {
        min-height: 36px;
    }
}