/* admin.css - COMPLETELY REDESIGNED */
:root {
    --primary-color: #2d5016;
    --primary-light: #4a7c2a;
    --secondary-color: #8db596;
    --accent-color: #f5a623;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --background: #f8faf7;
    --white: #ffffff;
    --border-light: #e8ebe6;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --shadow: 0 8px 32px rgba(45, 80, 22, 0.1);
    --radius: 16px;
    --gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Login Section */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(circle at 20% 80%, rgba(141, 181, 150, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(45, 80, 22, 0.05) 0%, transparent 50%),
        var(--background);
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(141, 181, 150, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.logo-section h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-input, .form-select, .form-textarea {
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
    transform: translateY(-2px);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn-primary {
    background: var(--gradient);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary::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-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(45, 80, 22, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(45, 80, 22, 0.2);
}

.btn-primary.large {
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
}

.btn-primary.full-width {
    width: 100%;
}

/* Loading Spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Messages */
.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 500;
    border: 1px solid;
}

.status-message.success {
    background: #d4edda;
    color: var(--success-color);
    border-color: #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: var(--error-color);
    border-color: #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.status-message.warning {
    background: #fff3cd;
    color: var(--warning-color);
    border-color: #ffeaa7;
}

/* Admin Dashboard */
.admin-dashboard {
    min-height: 100vh;
    background: var(--background);
}

/* Header */
.admin-header {
    background: var(--white);
    box-shadow: var(--shadow);
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

.admin-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.admin-email {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.admin-status {
    color: var(--success-color);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Main Content */
.admin-main {
    padding: 2.5rem 0;
}

/* Stats Section */
.stats-section {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(141, 181, 150, 0.2);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(45, 80, 22, 0.15);
}

.stat-icon {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border-radius: 50%;
    color: var(--white);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-info p {
    color: var(--text-light);
    font-weight: 500;
}

/* Search Section */
.search-section {
    margin-bottom: 2.5rem;
}

.search-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid rgba(141, 181, 150, 0.2);
}

.search-card h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.search-card p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.search-input-group {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Order Details */
.order-details-section {
    margin-bottom: 2.5rem;
}

.order-details-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(141, 181, 150, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.card-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.order-actions {
    display: flex;
    gap: 1rem;
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-group label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

.info-value {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Delivery Update Section */
.delivery-update-section {
    border-top: 2px solid var(--border-light);
    padding-top: 2rem;
}

.delivery-update-section h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
}

/* Active Orders */
.active-orders-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.orders-list {
    display: grid;
    gap: 1rem;
}

.order-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(141, 181, 150, 0.2);
}

.order-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(45, 80, 22, 0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.order-number {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.order-status {
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-confirmed { background: #d1ecf1; color: #0c5460; }
.status-packed { background: #d4edda; color: #155724; }
.status-in_transit { background: #cce7ff; color: #004085; }
.status-arrived { background: #e2e3ff; color: #383d41; }
.status-delivered { background: #d4edda; color: #155724; }

.order-customer {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.order-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

.notification.success { border-left-color: var(--success-color); }
.notification.error { border-left-color: var(--error-color); }
.notification.warning { border-left-color: var(--warning-color); }
.notification.info { border-left-color: var(--primary-color); }

.notification-message {
    flex: 1;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .login-card {
        padding: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .admin-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .order-info-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .order-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .section-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .admin-main {
        padding: 1.5rem 0;
    }
    
    .search-card,
    .order-details-card {
        padding: 1.5rem;
    }
    
    .order-info-grid {
        padding: 1rem;
    }
    
    .notification-container {
        right: 10px;
        left: 10px;
    }
    
    .notification {
        max-width: none;
    }
}