/* ===============================================
   ADMIN PANEL STYLES
   =============================================== */

/* Back to Home Button */
.back-to-home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #03045E 0%, #0077B6 50%, #00B405 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(3, 4, 94, 0.3);
    z-index: 10000;
    transition: all 0.3s ease;
}

.back-to-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(3, 4, 94, 0.4);
    background: linear-gradient(135deg, #023E8A 0%, #0096C7 50%, #00D408 100%);
}

.back-to-home-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.back-to-home-btn:hover i {
    transform: translateX(-3px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .back-to-home-btn {
        top: 15px;
        left: 15px;
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

/* Login Container */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.4s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.login-icon i {
    font-size: 3rem;
    color: var(--white);
}

.login-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-light);
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.btn-block {
    width: 100%;
}

/* Admin Header */
.admin-header {
    background: var(--dark);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header .brand-text {
    color: var(--white);
    -webkit-text-fill-color: white;
}

.admin-header .brand-tagline {
    color: rgba(255, 255, 255, 0.7);
}

.admin-actions {
    display: flex;
    gap: 15px;
}

/* Admin Content */
.admin-content {
    padding: 40px 0;
    min-height: calc(100vh - 100px);
    background: var(--bg-light);
}

.admin-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-top h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    animation: slideIn 0.6s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 1.8rem;
    color: var(--white);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark);
    font-family: 'Orbitron', sans-serif;
}

.stat-info p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Table Section */
.table-section {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
}

.products-table th {
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.products-table td {
    padding: 18px 15px;
    border-bottom: 1px solid var(--border);
}

.products-table tbody tr {
    transition: background 0.3s;
}

.products-table tbody tr:hover {
    background: var(--bg-light);
}

.table-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-buttons button:first-child {
    background: var(--primary-color);
    color: var(--white);
}

.action-buttons button:last-child {
    background: #ef4444;
    color: var(--white);
}

/* Product Modal */
.modal-dialog {
    background: var(--white);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.4s ease;
}

.modal-dialog.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: var(--bg-light);
    color: var(--dark);
}

.modal-body {
    padding: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.image-preview {
    margin: 20px 0;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 25px;
    border-top: 2px solid var(--border);
}

/* Success Message */
.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Image Upload Options */
.image-upload-options {
    border: 2px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.upload-tabs {
    display: flex;
    background: var(--bg-light);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.upload-tab {
    padding: 20px;
    display: none;
}

.upload-tab.active {
    display: block;
}

.suggested-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.suggestion-item {
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.suggestion-item:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
}

.suggestion-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 8px;
}

.suggestion-item span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.suggestion-note {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

/* File Upload Styles */
.file-upload-area {
    text-align: center;
}

.upload-dropzone {
    border: 3px dashed var(--border);
    border-radius: 10px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-light);
}

.upload-dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
}

.upload-dropzone i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-dropzone h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.upload-dropzone p {
    color: var(--text-light);
    margin-bottom: 10px;
}

.upload-dropzone small {
    color: var(--text-light);
    font-size: 0.85rem;
}

.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
    border-radius: 4px;
}

.upload-progress p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .table-section {
        overflow-x: auto;
    }

    .products-table {
        min-width: 800px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-actions {
        flex-direction: column;
        width: 100%;
    }

    .admin-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

