/* ===== ADMIN STYLES ===== */

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #2c3e50, #4a6491) !important;
}

/* Admin Navigation */
.admin-nav {
    background: #34495e;
    padding: 0;
}

.admin-nav .container {
    display: flex;
    gap: 0;
}

.admin-nav a {
    color: #ecf0f1 !important;
    padding: 15px 25px !important;
    border-radius: 0 !important;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.admin-nav a:hover, .admin-nav a.active {
    background: #1abc9c !important;
    color: white !important;
}

.admin-nav a i {
    margin-right: 8px;
}

/* Admin Main Content */
.admin-main {
    padding: 40px 0;
    min-height: 70vh;
}

.admin-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1abc9c;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 25px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #f39c12, #d35400);
}

.stat-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card p {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
}

.stat-card i {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 50px;
    opacity: 0.2;
}

/* Forms */
.add-product-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.add-product-form h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1abc9c;
    outline: none;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Image Upload */
.image-upload {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #1abc9c;
    background: #f8f9fa;
}

.upload-area i {
    font-size: 36px;
    color: #3498db;
    margin-bottom: 10px;
}

.upload-area p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.preview-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #219653;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.logout-btn {
    background: #e74c3c;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table thead {
    background: #2c3e50;
    color: white;
}

.admin-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.admin-table .btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    margin: 0 3px;
}

/* Status Badges */
.status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.status.pending {
    background: #fef9e7;
    color: #f39c12;
}

.status.completed {
    background: #e8f6f3;
    color: #27ae60;
}

.status.cancelled {
    background: #fdEDec;
    color: #e74c3c;
}

/* Product List */
.product-list {
    margin-top: 30px;
}

.product-list .search-box {
    margin-bottom: 20px;
    max-width: 400px;
}

/* Admin Footer */
.admin-footer {
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}

.admin-footer p {
    margin: 5px 0;
    font-size: 14px;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-nav .container {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .admin-nav a {
        white-space: nowrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .image-upload {
        grid-template-columns: 1fr;
    }
}

/* Admin Panel Specific Styles */

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a6d2c, #2e8b57);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-info p {
    color: #1a6d2c;
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

/* Activity Section */
.activity-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item i {
    color: #1a6d2c;
    font-size: 18px;
}

.activity-details p {
    margin: 0 0 5px 0;
    color: #333;
}

.activity-details small {
    color: #888;
    font-size: 12px;
}

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #1a6d2c;
    border-color: #1a6d2c;
    color: white;
    transform: translateY(-3px);
}

.action-btn i {
    font-size: 24px;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1a6d2c;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 109, 44, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Image Upload */
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.upload-box {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.upload-box:hover {
    border-color: #1a6d2c;
    background: #f9fffa;
}

.upload-box i {
    font-size: 36px;
    color: #888;
    margin-bottom: 10px;
}

.upload-box p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.preview-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: none;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.admin-table thead {
    background: #1a6d2c;
    color: white;
}

.admin-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-table tr:hover {
    background: #f9fffa;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.table-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #eee;
}

/* Badges */
.category-badge {
    background: #e8f5e9;
    color: #1a6d2c;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.stock-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.stock-badge.in-stock {
    background: #e8f5e9;
    color: #1a6d2c;
}

.stock-badge.low-stock {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-badge.pending {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.processing {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.completed {
    background: #e8f5e9;
    color: #1a6d2c;
}

.status-badge.cancelled {
    background: #ffebee;
    color: #c62828;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-success {
    background: #1a6d2c;
    color: white;
}

.btn-success:hover {
    background: #0d4d1f;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    margin: 0 3px;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-view {
    background: #95a5a6;
    color: white;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 12px 25px;
    background: #f8f9fa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover,
.tab-btn.active {
    background: #1a6d2c;
    color: white;
}

.settings-tab {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.settings-tab.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.security-warning {
    background: #fff3e0;
    border-left: 4px solid #ffb300;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.security-warning i {
    color: #ffb300;
    margin-right: 10px;
}

/* Orders Stats */
.orders-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-badge {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-badge.pending {
    background: linear-gradient(135deg, #ffb300, #ff8f00);
}

.stat-badge.processing {
    background: linear-gradient(135deg, #42a5f5, #1976d2);
}

.stat-badge.completed {
    background: linear-gradient(135deg, #66bb6a, #1a6d2c);
}

.stat-badge.cancelled {
    background: linear-gradient(135deg, #ef5350, #c62828);
}

.stat-badge span {
    font-size: 28px;
    font-weight: bold;
}

.stat-badge small {
    font-size: 14px;
    opacity: 0.9;
}

/* Search and Filter */
.search-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-filter input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.search-filter select {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover,
.page-btn.active {
    background: #1a6d2c;
    color: white;
    border-color: #1a6d2c;
}

/* No Data */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.no-data i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-data p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .orders-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-table {
        font-size: 14px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px;
    }
}