/* Admin Dashboard Styles */

.admin-login {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    color: #374151;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.error-message {
    color: #DC2626;
    margin-top: 1rem;
    display: none;
}

/* Admin Dashboard Layout */
.admin-dashboard {
    display: none;
    min-height: 100vh;
    background: #f9fafb;
}

.admin-header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
}

.admin-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.admin-nav a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: #667eea;
}

.btn-logout {
    background: #DC2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #b91c1c;
}

.admin-main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Dashboard Stats */
.dashboard-stats {
    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: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

/* Admin Controls */
.admin-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-controls input,
.admin-controls select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
}

.admin-controls input:focus,
.admin-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-refresh,
.btn-export,
.btn-clear,
.btn-setup {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-refresh {
    background: #10b981;
    color: white;
}

.btn-refresh:hover {
    background: #059669;
}

.btn-export {
    background: #667eea;
    color: white;
}

.btn-export:hover {
    background: #5a67d8;
}

.btn-clear {
    background: #DC2626;
    color: white;
}

.btn-clear:hover {
    background: #b91c1c;
}

.btn-setup {
    background: #f59e0b;
    color: white;
}

.btn-setup:hover {
    background: #d97706;
}

/* Orders Table */
.orders-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.orders-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.orders-header h2 {
    color: #374151;
    font-size: 1.3rem;
    font-weight: 600;
}

.orders-table-container {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th,
.orders-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.orders-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orders-table td {
    color: #6b7280;
    font-size: 0.9rem;
}

.orders-table tr:hover {
    background: #f9fafb;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.status-processing {
    background: #e0e7ff;
    color: #3730a3;
}

.status-shipped {
    background: #ddd6fe;
    color: #5b21b6;
}

.status-delivered {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-view,
.btn-status {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-view {
    background: #667eea;
    color: white;
}

.btn-view:hover {
    background: #5a67d8;
}

.btn-status {
    background: #10b981;
    color: white;
}

.btn-status:hover {
    background: #059669;
}

/* Order Details Modal */
.order-details-modal .modal-content {
    max-width: 800px;
}

.order-details-content {
    padding: 2rem;
}

.order-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.order-section {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
}

.order-section h3 {
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.order-field {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.order-field label {
    color: #6b7280;
    font-weight: 500;
}

.order-field span {
    color: #374151;
    font-weight: 600;
}

/* Database Setup Section */
.db-setup-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.db-setup-section h2 {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.db-config-form {
    display: grid;
    gap: 1.5rem;
    max-width: 500px;
}

.db-config-form .form-group {
    margin-bottom: 1rem;
}

.db-config-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
}

.db-config-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
}

.db-config-form input:focus {
    outline: none;
    border-color: #667eea;
}

.db-status {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.db-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.db-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.db-status.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.db-status.show {
    display: block;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
}

.status-indicator.connected {
    background: #10b981;
}

.status-indicator.disconnected {
    background: #DC2626;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #DC2626;
}

.notification.info {
    background: #667eea;
}

/* Responsive Admin Design */
@media (max-width: 768px) {
    .admin-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .admin-nav {
        width: 100%;
        justify-content: space-around;
    }
    
    .admin-main {
        padding: 1rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .orders-table-container {
        font-size: 0.8rem;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 0.5rem;
    }
    
    .order-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 2rem;
    }
    
    .admin-main {
        padding: 0.5rem;
    }
    
    .orders-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}