/* Admin Panel Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.admin-sidebar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #ff6b35;
}

.nav-item i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    margin-left: 250px;
    background-color: #f8f9fa;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#page-title {
    margin: 0;
    color: #2d3436;
    font-size: 1.8rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.admin-content {
    padding: 30px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 20px;
}

.stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, #ff6b35, #f7931e); color: white; }
.stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #f093fb, #f5576c); color: white; }
.stat-card:nth-child(4) .stat-icon { background: linear-gradient(135deg, #4facfe, #00f2fe); color: white; }

.stat-info h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #2d3436;
}

.stat-info p {
    margin: 5px 0 0 0;
    color: #636e72;
    font-weight: 500;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin: 0 0 20px 0;
    color: #2d3436;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Recent Activity */
.recent-activity {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.recent-activity h3 {
    margin: 0 0 20px 0;
    color: #2d3436;
    font-size: 1.2rem;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.activity-item:hover {
    background: #e9ecef;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ff6b35;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 15px;
}

.activity-content p {
    margin: 0;
    color: #2d3436;
    font-weight: 500;
}

.activity-content span {
    color: #636e72;
    font-size: 0.8rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    margin: 0;
    color: #2d3436;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #c82333;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filters-bar input,
.filters-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 150px;
}

.filters-bar input:focus,
.filters-bar select:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

/* Data Tables */
.data-table {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2d3436;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .actions {
    display: flex;
    gap: 5px;
}

/* Categories Grid */
.categories-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.category-card-admin {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-info h3 {
    margin: 0;
    color: #2d3436;
    font-size: 1.2rem;
}

.category-info p {
    margin: 5px 0 0 0;
    color: #636e72;
}

/* Comments List */
.comments-list-admin {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-admin {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.comment-header-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: #2d3436;
}

.comment-date {
    color: #636e72;
    font-size: 0.8rem;
}

.comment-text {
    color: #495057;
    line-height: 1.6;
}

.comment-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.analytics-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.analytics-card h3 {
    margin: 0 0 20px 0;
    color: #2d3436;
    font-size: 1.2rem;
    font-weight: 600;
}

.top-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.top-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.top-item:last-child {
    border-bottom: none;
}

.top-item .name {
    font-weight: 500;
    color: #2d3436;
}

.top-item .value {
    color: #ff6b35;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #2d3436;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #2d3436;
}

/* Forms */
#recipe-form {
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2d3436;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

.ingredient-input,
.instruction-input {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.ingredient-item,
.instruction-item {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.remove-ingredient,
.remove-instruction {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-ingredient:hover,
.remove-instruction:hover {
    background: #c82333;
    transform: scale(1.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .filters-bar {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .data-table {
        overflow-x: auto;
    }

    .data-table table {
        min-width: 600px;
    }
}

/* Dark Theme Support */
[data-theme="dark"] .admin-container {
    background-color: #1a1a1a;
}

[data-theme="dark"] .admin-main {
    background-color: #2d3436;
}

[data-theme="dark"] .admin-header,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .chart-container,
[data-theme="dark"] .recent-activity,
[data-theme="dark"] .data-table,
[data-theme="dark"] .category-card-admin,
[data-theme="dark"] .comment-admin,
[data-theme="dark"] .analytics-card,
[data-theme="dark"] .modal-content {
    background: #34495e;
    color: #ecf0f1;
}

[data-theme="dark"] .stat-info h3,
[data-theme="dark"] .chart-container h3,
[data-theme="dark"] .recent-activity h3,
[data-theme="dark"] .section-header h2,
[data-theme="dark"] .analytics-card h3,
[data-theme="dark"] .modal-header h3 {
    color: #ecf0f1;
}

[data-theme="dark"] .data-table th {
    background: #2c3e50;
    color: #ecf0f1;
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: #34495e;
}

[data-theme="dark"] .activity-item,
[data-theme="dark"] .top-item {
    border-color: #7f8c8d;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .filters-bar input,
[data-theme="dark"] .filters-bar select {
    background: #2c3e50;
    border-color: #7f8c8d;
    color: #ecf0f1;
}

[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.7);
}
