/* Admin Panel Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ff6b35;
    --secondary: #4ecdc4;
    --dark: #0a0e27;
    --light: #f7f8fa;
    --white: #ffffff;
    --error: #e74c3c;
    --success: #2ecc71;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    background: var(--light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark), #1a1f3a);
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 32px;
}

.login-card h2 {
    margin-bottom: 24px;
    color: var(--text-dark);
}

/* Navbar */
.navbar {
    background: var(--dark);
    color: var(--white);
    padding: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome {
    color: var(--secondary);
    font-size: 14px;
}

.navbar h1 {
    font-size: 24px;
    color: var(--white);
}

/* Container */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Form Card */
.form-card {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}

.form-card h2 {
    margin-bottom: 8px;
    color: var(--text-dark);
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 32px;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-light);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: #ff8c5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--dark);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    justify-content: center;
}

.btn-primary .icon {
    transition: transform 0.3s;
}

.btn-primary:hover .icon {
    transform: translateX(4px);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Image Preview */
.image-preview {
    margin-top: 16px;
}

.image-preview img {
    max-width: 300px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Success Page */
.success-card {
    background: var(--white);
    padding: 60px 40px;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.success-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.success-card h2 {
    color: var(--success);
    margin-bottom: 16px;
}

.success-details {
    margin: 32px 0;
    padding: 24px;
    background: var(--light);
    border-radius: 8px;
}

.success-image {
    max-width: 300px;
    margin-top: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.success-actions {
    margin-top: 32px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .login-card,
    .form-card {
        padding: 24px;
    }

    .container {
        margin: 20px auto;
    }

    .nav-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .nav-right {
        flex-direction: column;
    }
}

/* Loading State */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: 2px solid var(--text-light);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Products List */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.products-list .empty {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
    font-size: 16px;
}

/* Product Card */
.product-card {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    padding: 20px;
    background: var(--light);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.product-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.2);
}

.product-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--white);
}

.product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-info h3 {
    margin: 0 0 8px 0;
    color: var(--text-dark);
    font-size: 18px;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--text-light);
}

.product-meta .category {
    background: var(--white);
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 500;
}

.product-meta .price {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
}

.product-meta .rating {
    color: var(--text-dark);
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: center;
}

/* Action Buttons */
.btn-edit,
.btn-delete,
.btn-danger {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
    border: none;
}

.btn-edit {
    background: var(--secondary);
    color: var(--white);
}

.btn-edit:hover {
    background: #6edfd7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.btn-delete,
.btn-danger {
    background: var(--error);
    color: var(--white);
}

.btn-delete:hover,
.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    padding: 32px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-bottom: 16px;
    color: var(--text-dark);
}

.modal-content p {
    margin-bottom: 12px;
    color: var(--text-dark);
}

.modal-content .warning {
    color: var(--error);
    font-weight: 600;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* Error/Loading States */
.error {
    padding: 16px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .product-thumb {
        margin: 0 auto;
    }

    .product-meta {
        justify-content: center;
    }

    .product-actions {
        flex-direction: row;
        justify-content: center;
    }

    .tabs {
        flex-direction: column;
    }
}