@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
    --primary-color: #1a4a76; /* Albastru academic */
    --accent-color: #27ae60;  /* Verde calm */
    --header-bg: #c0392b;     /* Roșu elegant pentru antet */
    --bg-color: #f4f7f6;
    --text-color: #333333;
    --card-bg: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-wrapper {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
    margin: 80px auto;
    animation: fadeIn 0.6s ease-out;
}

.form-wrapper h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    font-size: 24px;
}

.school-subtitle { text-align: center; font-size: 13px; color: #666; margin-top: -20px; margin-bottom: 30px; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: #555; }
.input-group input { width: 100%; padding: 12px; border: 1px solid #dcdcdc; border-radius: 8px; box-sizing: border-box; font-size: 15px; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.input-group input:focus { border-color: var(--primary-color); box-shadow: 0 0 8px rgba(26, 74, 118, 0.2); outline: none; }

.btn { background-color: var(--primary-color); color: white; border: none; padding: 14px 20px; width: 100%; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; }
.btn:hover { background-color: #123454; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.link-text { display: block; text-align: center; margin-top: 20px; font-size: 14px; color: #666; }
.link-text a { color: var(--primary-color); text-decoration: none; font-weight: 600; transition: color 0.3s ease; }
.link-text a:hover { color: var(--accent-color); }
.message { text-align: center; padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.message.error { background-color: #fdeaea; color: #e74c3c; border: 1px solid #f5c6c6; }
.message.success { background-color: #eafaf1; color: #27ae60; border: 1px solid #c3e6cb; }

/* --- HEADER ROȘU --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg); /* Am aplicat roșul aici */
    color: white; /* Textul devine alb */
    padding: 20px 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.school-title {
    font-size: 20px;
    font-weight: 600;
    color: white; /* Titlul devine alb pentru vizibilitate */
    margin: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 15px;
}

.btn-logout {
    background-color: white; /* Butonul devine alb */
    color: var(--header-bg); /* Textul devine roșu */
    padding: 10px 18px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn-logout:hover {
    background-color: #f4f7f6;
    transform: translateY(-1px);
}
/* --- SFÂRȘIT HEADER ROȘU --- */

.dashboard-content { padding: 40px; width: 100%; max-width: 1200px; box-sizing: border-box; animation: fadeIn 0.8s ease-out; }
.dashboard-card { background: var(--card-bg); padding: 30px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); margin-top: 20px; }
.action-bar { margin-top: 20px; margin-bottom: 20px; display: flex; justify-content: flex-end; }
.btn-upload { background-color: var(--accent-color); color: white; padding: 10px 20px; text-decoration: none; border-radius: 6px; font-weight: 600; transition: background 0.3s ease; }
.btn-upload:hover { background-color: #1e8449; }

.resources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }
.resource-card { background: #fff; border: 1px solid #eaeaea; border-radius: 8px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.resource-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
.resource-title { color: var(--primary-color); font-size: 18px; margin-top: 0; margin-bottom: 10px; }
.resource-meta { font-size: 12px; color: #888; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.resource-desc { font-size: 14px; color: #555; margin-bottom: 20px; }

.btn-download { display: inline-block; background-color: var(--primary-color); color: white; padding: 8px 15px; text-decoration: none; border-radius: 4px; font-size: 14px; transition: background 0.3s ease; }
.btn-download:hover { background-color: #123454; }

.category-badge { display: inline-block; background-color: #eef2f5; color: var(--primary-color); padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.filters-bar { background: white; padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 10px; flex-grow: 1; }
.filters-bar select { padding: 8px; border: 1px solid #dcdcdc; border-radius: 6px; font-family: inherit; }
.btn-filter { background-color: #6c757d; color: white; border: none; padding: 9px 15px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-filter:hover { background-color: #5a6268; }

.btn-delete { display: inline-block; background-color: #e74c3c; color: white; padding: 8px 15px; text-decoration: none; border-radius: 4px; font-size: 14px; margin-left: 10px; transition: background 0.3s ease; }
.btn-delete:hover { background-color: #c0392b; }
.resource-actions { display: flex; align-items: center; margin-top: 15px; }

.search-input { flex-grow: 1; min-width: 200px; padding: 9px 15px; border: 1px solid #dcdcdc; border-radius: 6px; font-family: inherit; font-size: 14px; transition: border-color 0.3s ease; }
.search-input:focus { border-color: var(--primary-color); outline: none; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; background: white; border-radius: 8px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; }
.admin-table th { background-color: var(--primary-color); color: white; }
.badge-role { padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.role-admin { background: #f39c12; color: white; }
.role-profesor { background: #3498db; color: white; }

.download-count { font-size: 13px; color: #27ae60; font-weight: 600; margin-left: auto; }
.btn-small { padding: 5px 10px; font-size: 12px; text-decoration: none; border-radius: 4px; margin-right: 5px; }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; grid-column: 1 / -1; }
.page-link { padding: 8px 14px; background: #fff; border: 1px solid #dcdcdc; border-radius: 6px; text-decoration: none; color: var(--primary-color); font-weight: 600; transition: all 0.3s ease; }
.page-link:hover { background: #f0f4f8; border-color: var(--primary-color); }
.page-link.active { background: var(--primary-color); color: white; border-color: var(--primary-color); pointer-events: none; }

.checkbox-group { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; margin-bottom: 20px; }
.checkbox-group input[type="checkbox"] { margin-top: 4px; width: 16px; height: 16px; cursor: pointer; }
.checkbox-group label { font-size: 13px; font-weight: 400; color: #555; line-height: 1.4; cursor: pointer; }

/* Butonul de Favorite */
.btn-favorite { background-color: #f8f9fa; color: #6c757d; padding: 8px 12px; text-decoration: none; border-radius: 6px; font-size: 13px; font-weight: 600; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #dcdcdc; }
.btn-favorite:hover { background-color: #e2e6ea; }
.btn-favorite.active { background-color: #fff3cd; color: #d35400; border-color: #ffe69c; }
.btn-favorite.active:hover { background-color: #ffecb5; }
/* Stiluri pentru Sistemul de Comentarii */
.comments-section {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.comments-summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.comments-summary:hover {
    color: var(--accent-color);
}

.comments-summary::-webkit-details-marker {
    display: none; /* Ascunde săgeata standard din browser */
}

.comment-list {
    margin-top: 15px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.comment-item {
    background: #f9f9f9;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 13px;
    border-left: 3px solid var(--accent-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 11px;
    color: #777;
}

.comment-header strong {
    color: var(--primary-color);
    font-size: 13px;
}

.comment-text {
    margin: 0;
    color: #444;
    line-height: 1.4;
}

.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.comment-input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: none; /* Oprește lărgirea textarea-ului */
}

.comment-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn-comment {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s ease;
}

.btn-comment:hover {
    background: #123454;
}
/* Stiluri Dashboard Admin */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    border-top: 4px solid var(--primary-color);
}

.stat-card h3 {
    margin: 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 10px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.chart-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}