/* ============================================
   Admin Panel Styles
   Modern, clean, functional interface
   ============================================ */

/* ============================================
   Login Screen
   ============================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-warm) 0%, var(--color-bg-alt) 100%);
    padding: var(--space-lg);
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    padding: var(--space-4xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.login-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    text-align: center;
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.login-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2xl);
}

.login-form {
    margin-bottom: var(--space-xl);
}

.login-footer {
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-accent);
    font-weight: 500;
    transition: gap var(--transition-fast);
}

.back-link:hover {
    gap: var(--space-sm);
}

/* ============================================
   Admin Navigation
   ============================================ */

.admin-nav {
    background: white;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.admin-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.admin-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.admin-brand h1 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    margin: 0;
}

.admin-badge {
    display: inline-block;
    background: var(--color-accent-light);
    color: var(--color-accent);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-family: var(--font-accent);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* ============================================
   Admin Dropdown
   ============================================ */

.admin-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    border: 1px solid var(--color-border);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: none;
    border: none;
    text-align: left;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--color-bg-warm);
    color: var(--color-text-primary);
}

.dropdown-item i {
    width: 18px;
    height: 18px;
}

.dropdown-item-danger {
    color: #dc3545;
}

.dropdown-item-danger:hover {
    background: #fff5f5;
    color: #c82333;
}

.dropdown-menu hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-xs) 0;
}

/* ============================================
   Admin Main Content
   ============================================ */

.admin-main {
    background: var(--color-bg-warm);
    min-height: calc(100vh - 80px);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
}

/* ============================================
   Stats Grid
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-3xl);
}

.stat-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--color-accent-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    color: var(--color-accent);
    width: 28px;
    height: 28px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ============================================
   Products Section
   ============================================ */

.products-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
    gap: var(--space-lg);
}

.section-header h2 {
    font-size: var(--text-2xl);
    margin: 0;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    width: 18px;
    height: 18px;
}

.search-box input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) var(--space-3xl);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    transition: border-color var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ============================================
   Products Table
   ============================================ */

.table-container {
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table thead {
    background: var(--color-bg-warm);
}

.products-table th {
    padding: var(--space-md) var(--space-xl);
    text-align: left;
    font-family: var(--font-accent);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.products-table td {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

.products-table tbody tr {
    transition: background var(--transition-fast);
}

.products-table tbody tr:hover {
    background: var(--color-bg-warm);
}

.products-table tbody tr:last-child td {
    border-bottom: none;
}

/* Product Image in Table */
.product-thumb {
    width: 60px;
    height: 75px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--color-bg-alt);
}

/* Product Info */
.product-name {
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
}

.product-desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* Price */
.price-tag {
    font-family: var(--font-accent);
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--space-sm);
}

.action-btn {
    padding: var(--space-sm);
    background: var(--color-bg-warm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
}

.action-btn i {
    width: 16px;
    height: 16px;
}

.action-btn.delete:hover {
    background: #fff5f5;
    border-color: #dc3545;
    color: #dc3545;
}

/* ============================================
   Modal Styles
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 5vh auto;
}

.modal-small {
    max-width: 500px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    font-size: var(--text-2xl);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-text-primary);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-xl);
    border-top: 1px solid var(--color-border);
}

/* ============================================
   Form Styles
   ============================================ */

.form-group {
    margin-bottom: var(--space-lg);
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.form-group label {
    display: block;
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

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

.char-count {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.help-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-sm);
}

.help-text a {
    color: var(--color-accent);
    text-decoration: underline;
}

.image-input-group {
    display: flex;
    gap: var(--space-sm);
}

.image-input-group input {
    flex: 1;
}

/* Error Message */
.error-message {
    background: #fff5f5;
    color: #c82333;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid #f5c6cb;
    margin-bottom: var(--space-lg);
    font-size: var(--text-sm);
}

.warning-text {
    color: #dc3545;
    font-size: var(--text-sm);
    margin-top: var(--space-md);
}

/* ============================================
   Image Preview
   ============================================ */

.image-preview {
    width: 100%;
    max-width: 300px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-warm);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-3xl);
    color: var(--color-text-muted);
}

.preview-placeholder i {
    width: 40px;
    height: 40px;
}

/* ============================================
   Product Card Preview
   ============================================ */

.product-card-preview {
    background: var(--color-bg-warm);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 350px;
    display: flex;
    flex-direction: column;
}

.product-card-preview .product-image {
    aspect-ratio: 3 / 3.8;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.product-card-preview .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-preview .product-category {
    font-family: var(--font-accent);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
    display: block;
}

.product-card-preview .product-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-sm);
}

.product-card-preview .product-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: 0;
    flex: 1;
}

.product-card-preview .product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.product-card-preview .product-price {
    font-family: var(--font-accent);
    font-size: var(--text-lg);
    font-weight: 700;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.toast {
    background: white;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-icon.success {
    color: #28a745;
}

.toast-icon.error {
    color: #dc3545;
}

.toast-icon.info {
    color: var(--color-accent);
}

.toast-message {
    flex: 1;
    font-size: var(--text-sm);
}

/* ============================================
   Button Styles
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    background: none;
}

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

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-warm);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn i {
    width: 18px;
    height: 18px;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .admin-nav-container {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-actions {
        flex-wrap: wrap;
    }
}

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

    .products-table th:nth-child(n+3),
    .products-table td:nth-child(n+3) {
        display: none;
    }

    .modal-container {
        width: 95%;
        margin: 10px auto;
    }

    .admin-container {
        padding: var(--space-xl) var(--space-lg);
    }

    .toast-container {
        left: var(--space-lg);
        right: var(--space-lg);
        bottom: var(--space-lg);
    }

    .toast {
        min-width: auto;
    }
}

/* ============================================
   Admin Tabs
   ============================================ */

.admin-tabs {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--space-md);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--color-accent);
    background: var(--color-accent-light);
}

.tab-btn.active {
    color: var(--color-accent);
    background: var(--color-accent-light);
}

.tab-btn i {
    width: 18px;
    height: 18px;
}

.tab-content {
    display: none;
}

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

.tab-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--space-xl);
}

/* ============================================
   Blog Post Table
   ============================================ */

.blog-thumb {
    width: 80px;
    height: 45px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--color-bg-alt);
}

.status-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.published {
    background: #d4edda;
    color: #155724;
}

.status-badge.draft {
    background: #fff3cd;
    color: #856404;
}

.status-badge.scheduled {
    background: #d1ecf1;
    color: #0c5460;
}

/* ============================================
   Blog Modal Styles
   ============================================ */

.modal-large {
    max-width: 900px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-accent);
}

.checkbox-label span {
    font-size: var(--text-base);
    color: var(--color-text-primary);
}

.seo-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.seo-fields .form-control {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    transition: border-color var(--transition-fast);
}

.seo-fields .form-control:focus {
    outline: none;
    border-color: var(--color-accent);
}
