/* =============================================
   ECOMMERCE DASHBOARD - MAIN STYLESHEET
   ============================================= */

/* ----- CSS Reset & Base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
    min-height: 100vh;
    padding: 2rem 1.5rem;
    color: #1a1f2e;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ----- Typography ----- */
h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2d3b5e, #1a253b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3b5e;
    margin-bottom: 1.5rem;
}

/* ----- Header Section ----- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-links {
    display: flex;
    gap: 12px;
}

/* ----- Buttons ----- */
.btn {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background: linear-gradient(135deg, #3a7bd5, #2d62b5);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2d62b5, #1e4a8f);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(45, 98, 181, 0.25);
}

.btn-secondary {
    background: white;
    color: #2d3b5e;
    border: 1px solid #dde3ed;
}

.btn-secondary:hover {
    background: #f8faff;
    border-color: #3a7bd5;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.btn-outline {
    background: transparent;
    color: #5a6a82;
    border: 1px solid #d0d9e4;
    box-shadow: none;
}

.btn-outline:hover {
    background: white;
    border-color: #3a7bd5;
    color: #2d3b5e;
}

.btn-large {
    padding: 16px 28px;
    font-size: 1.1rem;
    border-radius: 16px;
}

/* ----- Cards ----- */
.card {
    background: white;
    border-radius: 24px;
    padding: 1.5rem 2rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    margin-bottom: 2rem;
}

/* ----- Search Section ----- */
.search-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.search-input-group {
    flex: 1;
    min-width: 280px;
    display: flex;
    align-items: center;
    background: #f9fbfd;
    border: 1.5px solid #e2e9f2;
    border-radius: 16px;
    padding: 4px 4px 4px 20px;
    transition: all 0.2s;
}

.search-input-group:focus-within {
    border-color: #3a7bd5;
    box-shadow: 0 0 0 4px rgba(58, 123, 213, 0.1);
    background: white;
}

.search-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 0;
    font-size: 1rem;
    outline: none;
    color: #1a1f2e;
}

.search-input-group input::placeholder {
    color: #9aabbf;
    font-weight: 400;
}

.search-input-group button {
    background: linear-gradient(135deg, #3a7bd5, #2d62b5);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.search-input-group button:hover {
    background: linear-gradient(135deg, #2d62b5, #1e4a8f);
    transform: scale(1.02);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* ----- Tables ----- */
.table-container {
    background: white;
    border-radius: 24px;
    padding: 0.5rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.5);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 20px;
    overflow: hidden;
}

th {
    text-align: left;
    padding: 1.2rem 1rem;
    background: #f9fbfd;
    font-weight: 600;
    color: #2d3b5e;
    border-bottom: 2px solid #e2e9f2;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid #edf2f7;
    color: #2d3b5e;
    font-weight: 400;
}

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: #f5f9ff;
    cursor: default;
}

.price {
    font-weight: 600;
    color: #1e3a6f;
}

/* ----- Badges ----- */
.badge {
    padding: 4px 10px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #e6f7e6;
    color: #0d7c3f;
}

.badge-warning {
    background: #fff5e6;
    color: #b85b14;
}

.badge-info {
    background: #e6f0ff;
    color: #2d62b5;
}

/* ----- Pagination ----- */
.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 16px;
    border-radius: 60px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f7;
}

.pagination-btn {
    background: white;
    border: 1px solid #dde3ed;
    padding: 10px 18px;
    border-radius: 40px;
    font-weight: 600;
    color: #2d3b5e;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pagination-btn:hover:not(:disabled) {
    background: #3a7bd5;
    color: white;
    border-color: #3a7bd5;
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(58, 123, 213, 0.2);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 6px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: white;
    border: 1px solid #e2e9f2;
    font-weight: 500;
    color: #2d3b5e;
    cursor: pointer;
    transition: all 0.2s;
}

.page-number:hover {
    background: #eef4ff;
    border-color: #3a7bd5;
}

.page-number.active {
    background: linear-gradient(135deg, #3a7bd5, #2d62b5);
    color: white;
    border: none;
    box-shadow: 0 6px 12px rgba(58, 123, 213, 0.3);
}

.page-info {
    font-weight: 500;
    color: #5a6a82;
    background: white;
    padding: 8px 20px;
    border-radius: 40px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid #eef2f7;
}

/* ----- Footer ----- */
.footer {
    margin-top: 3rem;
    text-align: center;
    color: #7a8ba1;
    font-size: 0.9rem;
}

.footer a {
    color: #3a7bd5;
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* ----- Dashboard Home Cards ----- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dashboard-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.dashboard-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #2d3b5e;
}

.dashboard-card p {
    color: #5a6a82;
}
.status-select {
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background-color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    width: 130px;
}

.status-select:hover {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.status-select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Status-specific colors */
.status-select option[value="Pending"] { background-color: #fef3c7; color: #92400e; }
.status-select option[value="Processing"] { background-color: #dbeafe; color: #1e40af; }
.status-select option[value="Shipped"] { background-color: #e0e7ff; color: #3730a3; }
.status-select option[value="Delivered"] { background-color: #d1fae5; color: #065f46; }
.status-select option[value="Cancelled"] { background-color: #fee2e2; color: #991b1b; }

/* Selected value styling */
.status-select {
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    padding-right: 30px;
}
/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s;
}
.modal-content {
    background: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
}
.close {
    color: #94a3b8;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.close:hover {
    color: #1e293b;
}
.modal-body {
    padding: 24px;
}
.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.detail-label {
    font-weight: 600;
    width: 120px;
    color: #64748b;
}
.detail-value {
    flex: 1;
    color: #1e293b;
}
.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #64748b;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Clickable table rows */
#tableBody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#tableBody tr:hover {
    background-color: #f1f5f9 !important;
}