html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; 
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fff;
    border-left: 1px solid #eee;
}

::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff8c00;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #fff;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* Override body overflow for non-game pages */
body:not(.nivria-body) {
    overflow-y: scroll;
}

body:not(.nivria-body) main {
    flex: 1 0 auto;
    height: auto;
    min-height: 0;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100px;
}

.container::after {
    content: "";
    clear: both;
    display: table;
}

.container-footer {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    height: 20px;
}

.container-footer::after {
    content: "";
    clear: both;
    display: table;
}

header {
    background: #000;
    color: #fff;
    padding: 10px 0;
    min-height: 100px;
    border-bottom: #ff8c00 4px solid;
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
}

.logo-area {
    float: left;
    display: flex;
    align-items: center;
    gap: 15px;
    height: 80px;
}

.site-logo {
    height: 90px;
    width: auto;
    border-radius: 4px;
    padding-top: 10px;
}

header nav {
    float: right;
    margin-top: 25px;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.nav-list li {
    padding: 0 12px;
}

header a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: bold;
    transition: color 0.3s;
}

header a:hover {
    color: #ff8c00;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #000;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 9999;
    list-style: none;
    padding: 0;
    border: 1px solid #ff8c00;
    border-radius: 4px;
    right: 0;
}

.dropdown-content li {
    padding: 0;
    width: 100%;
}

.dropdown-content a {
    color: #fff;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-transform: none;
    font-size: 14px;
}

.dropdown-content a:hover {
    background-color: #ff8c00;
    color: #000;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    color: #ff8c00;
}

.nav-credits {
    background: #ff8c00;
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    float: right;
    margin-top: 30px;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #ff8c00;
    border-radius: 3px;
    transition: all 0.3s;
}

footer {
    padding-bottom: 20px;
    color: #fff;
    background-color: #000;
    text-align: center;
    border-top: #ff8c00 4px solid;
    flex-shrink: 0;
}

main {
    padding: 10px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Specific main for scroll pages */
.scroll-body main {
    height: auto;
    overflow: visible;
    flex: none;
}

.auth-form, .profile-form {
    width: 100%;
    max-width: 550px;
    min-width: 450px;
    margin: 20px auto;
    padding: 10px 20px 20px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

@media (max-width: 420px) {
    .auth-form, .profile-form {
        min-width: 0;
        width: 95%;
    }
}

.auth-form h2, .profile-form h2 {
    color: #000;
    border-bottom: 2px solid #ff8c00;
    margin-bottom: 5px;
    font-size: 1.5em;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background: #fdfdfd;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #ff8c00;
    outline: none;
    background: #fff;
}

.field-error {
    color: #d9534f;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
}

.error {
    background: #f2dede;
    color: #a94442;
    padding: 15px;
    margin-bottom: 25px;
    border: 1px solid #ebccd1;
    border-radius: 4px;
}

.success {
    background: #dff0d8;
    color: #3c763d;
    padding: 15px;
    margin-bottom: 25px;
    border: 1px solid #d6e9c6;
    border-radius: 4px;
}

button[type="submit"], .btn-primary {
    background: #ff8c00;
    color: #000;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    transition: background 0.3s, transform 0.1s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

button[type="submit"]:hover, .btn-primary:hover {
    background: #e67e00;
}

/* Index Stats */
.welcome {
    text-align: center; 
    padding: 0; 
    background-size: cover;
    background-position: center;
    border-radius: 12px; 
    margin-top: 20px;
    border-bottom: 5px solid #ff8c00;
    min-height: 450px;
    transition: opacity 0.3s;
}
.welcome-link:hover .welcome {
    opacity: 0.9;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.stat-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-top: 4px solid #ff8c00;
}
.stat-card h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.1em;
}
.stat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.stat-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.95em;
}
.stat-list li:last-child {
    border-bottom: none;
}
.stat-list .rank {
    font-weight: bold;
    color: #ff8c00;
    width: 25px;
}
.stat-list .name {
    flex-grow: 1;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 5px;
}

.user-link {
    color: #000;
    text-decoration: none;
    font-weight: bold;
    padding: 1px 2px;
    transition: all 0.2s ease;
}

.user-link:hover {
    color: #000;
    background-color: #ff8c00;
    border-radius: 3px;
    text-decoration: none;
}
.stat-list .value {
    font-weight: bold;
    color: #000;
}

/* Categories Grid */
.categorii-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.categorie-card {
    background: #fff;
    border: 1px solid #eee;
    text-align: center;
    text-decoration: none;
    color: #000;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.categorie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #ff8c00;
}
.categorie-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #000;
    position: relative;
}
.categorie-card h3 {
    margin: 20px 0;
    color: #000;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Test List & Banner */
.category-banner {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 20px;
    border-bottom: 5px solid #ff8c00;
}
.banner-content h1 {
    font-size: 2.5em;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
}
.banner-content p {
    font-size: 1.1em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}
.filters {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-btn {
    display: inline-block;
    padding: 8px 15px;
    background: #fff;
    text-decoration: none;
    color: #000;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s;
}
.filter-btn.active {
    background: #ff8c00;
    color: #000;
    border-color: #ff8c00;
}
.tutorial-link {
    color: #ff8c00;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 2px dashed #ff8c00;
    padding-bottom: 2px;
    font-size: 0.9em;
}

/* Responsive Tables */
.teste-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.teste-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    min-width: 600px;
}
.teste-table th, .teste-table td {
    padding: 12px 10px;
    border: 1px solid #ddd;
    text-align: left;
}
.teste-table th { 
    background: #000; 
    color: #fff;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
}
.teste-table th a {
    color: #ffffff !important;
    text-decoration: none;
    display: inline-block;
    width: 100%;
    vertical-align: middle;
}
.teste-table th a:hover {
    color: #ff8c00 !important;
}
.action-cell {
    text-align: center !important;
    width: 1%;
    white-space: nowrap;
}
.btn-start {
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid #000;
    font-size: 0.9em;
}
.score-badge {
    background: #ff8c00;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
}

.pagination {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}
.page-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}
.page-link.active {
    background: #ff8c00;
    color: #000;
    border-color: #ff8c00;
}

/* Test Execution */
.question-item {
    background: #fff;
    border: 1px solid #eee;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.context {
    font-style: italic;
    color: #555;
    margin-bottom: 15px;
    background: #fff8f0;
    padding: 15px;
    border-left: 4px solid #ff8c00;
    font-size: 0.95em;
}
.option-label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
    padding: 12px;
    border-radius: 6px;
    background: #f9f9f9;
    border: 1px solid #eee;
    transition: all 0.2s;
}
.option-label:hover {
    background: #fff5e6;
    border-color: #ff8c00;
}
.btn-submit {
    background: #ff8c00;
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    width: 100%;
}
.result-box {
    background: #000;
    color: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 5px solid #ff8c00;
}
.result-box h3 {
    color: #ff8c00;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.correct-answer {
    color: #ff8c00;
    font-weight: bold;
    margin-top: 10px;
    display: block;
}

/* Modal & Report Styles */
.btn-report {
    background: #000;
    color: #ff8c00;
    border: 1px solid #ff8c00;
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 15px;
    transition: all 0.3s;
}

.btn-report:hover {
    background: #ff8c00;
    color: #000;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    color: #333;
}

.close {
    color: #aaa;
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Nivria Game */
.nivria-game-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.game-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 5px;
    flex: 1;
    min-height: 0;
}

@media (min-width: 992px) {
    .game-layout {
        grid-template-columns: 350px 1fr;
        height: calc(100vh - 180px);
        max-height: calc(100vh - 180px);
        overflow: hidden;
        align-items: stretch;
    }
}

/* Common Card Style for Nivria */
.leaderboard-card, .game-main-card, .info-card {
    background: #fff;
    padding: 4px 10px 10px 10px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-top: 4px solid #ff8c00;
    box-sizing: border-box;
}

.game-main-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    min-height: 0;
}

@media (min-width: 992px) {
    .leaderboard-card {
        flex: 0 1 auto; /* Nu mai forțează extinderea, se pliază pe conținut */
        max-height: calc(100% - 250px); /* Limităm înălțimea pentru a lăsa loc info-card */
        overflow-y: auto;
        order: 1;
        min-height: 0;
    }
    
    .info-card {
        order: 2;
        flex-shrink: 0;
    }
}

.leaderboard-card h3 {
    color: #000;
    margin-bottom: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.1em;
}

.info-card h3 {
    color: #000;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.timer-display {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    color: #ff8c00;
    margin: 2px 0;
    padding-right: 20px;
}

.game-header-trivia {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.game-status {
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
}

.question-display {
    text-align: left;
    padding: 6px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 5px solid #ff8c00;
}

.question-display h2 {
    margin: 0;
    font-size: 1em;
    color: #000;
}

.chat-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 15px;
    background: #fff;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.chat-msg {
    padding: 6px 10px;
    border-radius: 6px;
    background: #f1f1f1;
    max-width: 80%;
    align-self: flex-start;
    font-size: 0.95em;
}

.chat-msg strong {
    color: #ff8c00;
    margin-right: 5px;
}

.chat-time {
    color: #999;
    font-size: 0.8em;
    margin-right: 8px;
}

.system-msg {
    background: #f9f9f9;
    color: #888;
    font-style: italic;
    align-self: flex-end;
    max-width: 100%;
    font-size: 0.8em;
    border: none;
    padding: 4px 10px;
}

.winner-msg {
    background: #d4edda;
    color: #155724;
    font-weight: bold;
    align-self: flex-start;
    border: 1px solid #c3e6cb;
    width: 100%;
    box-sizing: border-box;
}

.timeout-msg {
    background: #fff3cd;
    color: #856404;
    align-self: flex-start;
    border: 1px solid #ffeeba;
    width: 100%;
    box-sizing: border-box;
}

.hint-msg {
    background: #e1f5fe;
    color: #01579b;
    border: 1px solid #b3e5fc;
    align-self: flex-start;
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
}

.error-msg {
    background: #f8d7da;
    color: #721c24;
    align-self: center;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    padding-bottom: 5px;
}

.chat-input-area input {
    flex-grow: 1;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 6px;
    font-size: 1em;
}

.chat-input-area input:focus {
    border-color: #ff8c00;
    outline: none;
}

/* Animations */
@keyframes newQuestion {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.new-q-anim {
    animation: newQuestion 0.5s ease-out forwards;
}

/* Mobile Specific Adjustments */
@media (max-width: 768px) {
    header .container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        height: auto;
        min-height: 60px;
    }
    .nivria-game-container .side-panel {
        display: none;
    }
    .nivria-game-container .chat-layout {
        display: flex;
        flex-direction: column;
    }
    .nivria-game-container .game-header-trivia {
        display: none;
    }
    .nivria-game-container .chat-messages {
        order: 2;
        flex: 1;
        min-height: 250px; /* Asigură un spațiu minim pentru chat pe mobile */
        margin-bottom: 2px;
    }
    .nivria-game-container .question-display {
        order: 3;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    .nivria-game-container .chat-input-area {
        order: 4;
    }
    header {
        min-height: auto;
        padding-bottom: 15px;
    }
    .logo-area {
        float: none;
        justify-content: flex-start;
        margin-bottom: 0;
        height: auto;
    }
    .site-logo {
        height: 50px;
        width: auto;
        max-width: 200px;
    }
    header nav {
        display: none;
        float: none;
        width: 100%;
        background: #000;
        margin-top: 10px;
    }
    header nav.active {
        display: block;
    }
    .nav-list {
        flex-direction: column;
        width: 100%;
    }
    .nav-list li {
        width: 100%;
        text-align: center;
        padding: 10px 0;
        border-bottom: 1px solid #222;
    }
    .menu-toggle {
        float: none;
        margin-top: 0;
        margin-left: auto; /* Push to the right */
    }
    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        border: none;
        box-shadow: none;
        background: #111;
    }
    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .menu-toggle {
        display: flex;
    }
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .teste-table th:nth-child(1), .teste-table td:nth-child(1),
    .teste-table th:nth-child(3), .teste-table td:nth-child(3) {
        display: none;
    }
    
    .teste-table {
        min-width: auto;
    }

    .welcome {
        min-height: 300px;
    }
    .banner-content h1 {
        font-size: 2em;
    }
    .categorii-grid {
        grid-template-columns: 1fr;
    }
    .filters {
        flex-direction: column;
        text-align: center;
    }
    .filter-group {
        justify-content: center;
    }
    .auth-form, .profile-form {
        width: 90%;
        margin: 10px auto;
    }
}

/* Profile Image Styles */
.profile-image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.current-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: #ff8c00;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.profile-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 3em;
    font-weight: bold;
    color: #000;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 5px;
    border: 1px solid #ff8c00;
}

/* Friendship Buttons */
.btn-friend {
    background: #ff8c00;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
}

.btn-friend:hover:not(:disabled) {
    background: #e67e00;
    transform: translateY(-2px);
}

.btn-friend:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

.friend-badge {
    background: #28a745;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}

/* --- Public Profile Page Styles --- */
.public-profile-container {
    max-width: 800px;
    margin: 0 auto;
}
.profile-header-card {
    background: #000;
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    border-bottom: 5px solid #ff8c00;
}
.profile-avatar {
    width: 100px;
    height: 100px;
    background: #ff8c00;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    font-weight: bold;
}
.profile-info-main h2 {
    margin: 0;
    font-size: 2.5em;
    color: #ff8c00;
}
.member-since {
    color: #888;
    margin: 5px 0 15px;
}
.profile-badge {
    background: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.stat-box {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border-top: 4px solid #ff8c00;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #000;
}
.stat-label {
    color: #666;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 1px;
}
.profile-details-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.profile-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
.profile-table th {
    text-align: left;
    width: 150px;
    padding: 10px 0;
    color: #888;
}
.profile-table td {
    font-weight: bold;
    color: #000;
}

@media (max-width: 600px) {
    .profile-header-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Friends and Chat Page Styles --- */
.friends-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}
.friends-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    height: calc(100vh - 220px);
    min-height: 500px;
}
.friends-list-side {
    flex: 0 0 350px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
}
.friends-section {
    padding: 5px 10px 10px 10px;
    overflow-y: auto;
}
.friends-section h3 {
    font-size: 0.9em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 15px;
    letter-spacing: 1px;
}
.chat-side {
    flex: 1;
    width: 500px;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.chat-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #ccc;
    text-align: center;
    padding: 40px;
}
.chat-box {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.chat-header {
    padding: 15px 25px;
    background: #000;
    color: #ff8c00;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.chat-header span {
    font-weight: bold;
    font-size: 1.2em;
}
#delete-chat-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid #444;
    color: #aaa;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s;
}
#delete-chat-btn:hover {
    background: #d9534f;
    color: #fff;
    border-color: #d9534f;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #fdfdfd;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-msg {
    max-width: 75%;
    padding: 2px 10px;
    border-radius: 20px;
    position: relative;
    font-size: 0.95em;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.chat-msg.sent {
    align-self: flex-end;
    background: #ff8c00;
    color: #000;
    border-bottom-right-radius: 4px;
}
.chat-msg.received {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border: 1px solid #eee;
    border-bottom-left-radius: 4px;
}
.msg-time {
    font-size: 0.7em;
    opacity: 0.5;
    margin-top: 5px;
    text-align: right;
}
.chat-input-area {
    padding: 6px 6px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 5px;
    background: #fff;
}
.chat-input-area input {
    flex: 1;
    padding: 12px 10px;
    border: 1px solid #ddd;
    border-radius: 30px;
    outline: none;
    font-size: 1em;
    transition: border-color 0.3s;
}
.chat-input-area input:focus {
    border-color: #ff8c00;
}
.chat-input-area button {
    background: #ff8c00;
    color: #000;
    border: none;
    padding: 0 15px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}
.chat-input-area button:hover {
    background: #e67e00;
}

/* Compact Friend Cards */
.friends-grid.compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.friend-card {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #eee;
    transition: all 0.2s;
}
.friend-card:hover {
    border-color: #ff8c00;
    transform: translateX(5px);
}
.friend-card.active {
    background: #fff;
    border-color: #ff8c00;
    box-shadow: 0 4px 10px rgba(255,140,0,0.1);
}
.friend-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.friend-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #ff8c00;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.friend-name {
    font-weight: 600;
    color: #333;
    text-decoration: none;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.friend-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}
.btn-friend.chat-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.unread-badge {
    background: #ff0000;
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.7em;
    font-weight: bold;
}

@media (max-width: 900px) {
    .friends-layout {
        flex-direction: column;
        height: auto;
    }
    .friends-list-side {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .chat-side {
        height: 500px;
    }
}

/* --- Admin Pages Styles --- */
.admin-container {
    max-width: 1100px;
    margin: 20px auto;
}
.admin-container h2 {
    border-bottom: 2px solid #ff8c00;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.admin-edit-question-container {
    max-width: 800px;
}
textarea:focus {
    border-color: #ff8c00;
    outline: none;
    background: #fff;
}

/* --- Carousel Quiz Styles --- */
.hidden-q {
    display: none !important;
}
.question-item.active {
    display: block;
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.test-timer-container {
    width: 100%;
    height: 30px;
    background: #eee;
    border-radius: 15px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid #ddd;
}
#test-timer-bar {
    height: 100%;
    width: 100%;
    background: #ff8c00;
    transition: width 1s linear, background 0.3s;
}
#test-timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #000;
    font-size: 0.9em;
    text-shadow: 0 0 2px #fff;
}
.correct-q {
    border-left: 5px solid #28a745 !important;
    background: #f8fff9 !important;
}
.wrong-q {
    border-left: 5px solid #d9534f !important;
    background: #fffafa !important;
}
.correct-option {
    background: #d4edda !important;
    border-color: #28a745 !important;
    color: #155724 !important;
    font-weight: bold;
}

/* --- Tutorial Page Styles --- */
.tutorial-container-wide {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}
.tutorial-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}
.tutorial-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.tutorial-card:hover {
    transform: translateY(-5px);
    border-color: #ff8c00;
}
.card-icon {
    font-size: 3em;
    margin-bottom: 15px;
}
.tutorial-card h3 {
    color: #000;
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 2px solid #ff8c00;
    padding-bottom: 8px;
    display: inline-block;
    align-self: flex-start;
}
.tutorial-card ul {
    padding-left: 20px;
    margin-top: 15px;
}
.tutorial-card li {
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95em;
}
.tutorial-mini-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    font-size: 0.9em;
}
.tutorial-mini-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
}
.tutorial-mini-table td:last-child {
    font-weight: bold;
    text-align: right;
    color: #ff8c00;
}
.tutorial-footer-actions {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-back-styled {
    display: inline-block;
    padding: 12px 25px;
    border: 2px solid #ff8c00;
    color: #ff8c00;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9em;
    background: transparent;
}

.btn-back-styled:hover {
    background: #ff8c00;
    color: #000;
    box-shadow: 0 4px 12px rgba(255,140,0,0.3);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .btn-back-styled {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* Footer Nou */
footer {
    background-color: #000;
    color: #fff;
    padding: 40px 0 20px 0 !important;
    border-top: 4px solid #ff8c00;
    text-align: left !important;
}

.footer-container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-box h3 {
    color: #ff8c00;
    font-size: 1.1em;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: bold;
}

.footer-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-box ul li {
    margin-bottom: 10px;
}

.footer-box ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-box ul li a:hover {
    color: #ff8c00;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85em;
    color: #999;
}

/* Responsivitate Footer */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Ascunde grid-ul footer-ului în Nivria pe Mobile */
@media (max-width: 768px) {
    body.nivria-body .footer-grid {
        display: none;
    }
    body.nivria-body footer {
        padding: 10px 0 !important;
    }
}
