/*
 * CATALYST Stylesheet
 *
 * This file contains all the CSS styles for the CATALYST e-learning platform.
 * It's structured with a focus on a clean, modern, and responsive design.
 *
 * Contents:
 * - Root Variables for consistent theming.
 * - General and Body Styles.
 * - App Bar and Navigation.
 * - Login Section and Forms.
 * - Dashboard and Post Feed.
 * - Post Components (Header, Content, Images, Footer).
 * - Side Menu and Overlay.
 * - Media Queries for responsiveness.
 * - Security enhancements to prevent content inspection.
 */

:root {
    --primary-color: #6C5CE7;
    --secondary-color: #A29BFE;
    --dark-color: #2D3436;
    --light-color: #F5F6FA;
    --accent-color: #00CE9F;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    /* ✨ This is the key change */
    background: url('logo.png') no-repeat center center fixed; 
    background-size: cover;
    
    min-height: 100vh;
    color: var(--dark-color);
    direction: rtl; /* Set direction for the entire body */
}

.app-bar {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 15px;
    text-align: center;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.app-bar h1 {
    font-weight: bold;
    font-size: 20px;
}

.container {
    padding: 20px;
    max-width: 100%;
}

.login-form {
    /* ✨ Added a semi-transparent white background to make the form readable */
    background-color: rgba(255, 255, 255, 0.85); 
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* 👇 This is the new line to move the box down */
    margin-top: 250px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--dark-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: none;
    background-color: var(--light-color);
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s;
    text-align: right;
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
    width: 100%;
    margin-top: 10px;
}

.btn:hover {
    background-color: #5a4bd1;
    transform: translateY(-2px);
}

.logo {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

.posts-container {
    margin-top: 20px;
}

.post-card {
    background-color: white;
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.post-user {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 16px;
}

.post-time {
    color: #666;
    font-size: 12px;
}

.post-content {
    margin-bottom: 15px;
    line-height: 1.5;
}

.post-images {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 15px;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    max-height: 500px;
}

.post-images-container {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
    width: 100%;
}

.post-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

.images-indicator {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.indicator-dot.active {
    background-color: white;
    transform: scale(1.2);
}

.post-footer {
    display: flex;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.like-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.like-btn.liked {
    color: red;
}

.likes-count {
    margin-left: 5px;
}

.error-message {
    color: red;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

.success-message {
    color: var(--accent-color);
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

.hidden {
    display: none;
}

.loading {
    text-align: center;
    margin: 20px 0;
    color: var(--dark-color);
}

.list-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* Side Menu Styles */
.side-menu {
    position: fixed;
    top: 0;
    right: -280px; /* Hidden by default */
    width: 280px;
    height: 100%;
    background-color: var(--light-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.side-menu.show {
    right: 0;
}

.side-menu-header {
    background-color: var(--primary-color);
    color: white;
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.side-menu-header i {
    font-size: 60px;
    margin-right: -480px;
    margin-bottom: 8px;
}

.side-menu-header span {
    font-size: 20px;
    font-weight: bold;
}

.side-menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--dark-color);
    font-size: 16px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    text-align: right; /* Ensure text is aligned correctly */
}

.side-menu-item:hover {
    background-color: #f0f0f0;
}

.side-menu-item i {
    margin-right: -120px; /* Change margin to right for RTL */
    margin-left: 0px; /* Remove left margin */
    color: var(--primary-color);
}

.side-menu-item span {
    flex-grow: 1; /* Allow the text to take available space */
    text-align: right;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .post-images {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 150px;
        height: 150px;
    }

    .post-images {
        max-height: 300px;
        min-height: 150px;
    }
}