/* General Body and Typography */
:root {
    --primary-color: #007bff; /* Myeleq Blue */
    --secondary-color: #ffc107; /* Myeleq Yellow */
    --accent-color: #17a2b8; /* A complementary blue */
    --background-color: #f8f9fa; /* Light background */
    --card-background: #ffffff; /* White cards */
    --text-color: #343a40; /* Dark grey text */
    --light-text-color: #6c757d; /* Lighter grey text */
    --border-color: #dee2e6; /* Light grey border */
    --success-color: #28a745;
    --error-color: #dc3545;
    --font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --border-radius: 8px;
    --transition-speed: 0.3s ease;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

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

/* Header */
header {
    background-color: var(--card-background);
    color: var(--text-color);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo a {
    color: inherit;
    text-decoration: none;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

nav ul li {
    margin-left: 20px;
    position: relative;
}

nav ul li a {
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 0;
    display: block;
}

nav ul li a:hover {
    color: var(--primary-color);
}

.notification-count {
    background-color: var(--error-color);
    color: white;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 0.75rem;
    position: absolute;
    top: -5px;
    right: -15px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: border-color var(--transition-speed), background-color var(--transition-speed);
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}

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

/* Buttons */
.button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed);
    border: 1px solid transparent;
}

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

.button.primary:hover {
    background-color: #0056b3;
}

.button.secondary {
    background-color: var(--light-text-color);
    color: white;
}

.button.secondary:hover {
    background-color: #5a6268;
}

.button.danger {
    background-color: var(--error-color);
    color: white;
}

.button.danger:hover {
    background-color: #c82333;
}

.button.like-button {
    background-color: var(--border-color);
    color: var(--text-color);
    padding: 5px 10px;
    font-size: 0.9rem;
}

.button.like-button.liked {
    background-color: var(--primary-color);
    color: white;
}

.button.like-button:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Flash Messages */
.flash-message {
    padding: 10px 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.flash-message.success {
    background-color: #d4edda;
    color: var(--success-color);
    border: 1px solid #c3e6cb;
}

.flash-message.error {
    background-color: #f8d7da;
    color: var(--error-color);
    border: 1px solid #f5c6cb;
}

/* Cards and Sections */
section {
    background-color: var(--card-background);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Forum Specific */
.category-list ul,
.topic-list ul,
.reply-list ul {
    list-style: none;
    padding: 0;
}

.category-item,
.topic-item,
.reply-item {
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.category-item:last-child,
.topic-item:last-child,
.reply-item:last-child {
    border-bottom: none;
}

.topic-header h2 {
    margin-bottom: 5px;
}

.topic-header p {
    font-size: 0.9rem;
    color: var(--light-text-color);
}

.topic-content img,
.topic-content video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: var(--border-radius);
}

.reply-item {
    margin-left: 20px;
    border-left: 3px solid var(--border-color);
    padding-left: 15px;
}

/* Profile Page */
.profile-info p {
    margin-bottom: 5px;
}

.profile-info strong {
    color: var(--primary-color);
}

/* Admin Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: white;
    margin-top: 0;
    font-size: 1.2rem;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-section {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.admin-table th {
    background-color: var(--primary-color);
    color: white;
}

.admin-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Messages */
.messages-container {
    display: flex;
    gap: 20px;
    min-height: 60vh;
}

.conversations-list {
    flex: 1;
    background-color: var(--card-background);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.conversations-list ul {
    list-style: none;
    padding: 0;
}

.conversations-list li {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.conversations-list li.active {
    background-color: var(--primary-color);
}

.conversations-list li.active a {
    color: white;
}

.conversations-list li a {
    display: block;
    color: var(--text-color);
}

.conversations-list li a:hover {
    text-decoration: none;
    color: var(--primary-color);
}

.message-thread {
    flex: 3;
    background-color: var(--card-background);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.message-list {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 15px;
}

.message-item {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    max-width: 70%;
}

.message-item.sent {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.message-item.received {
    background-color: var(--border-color);
    color: var(--text-color);
    align-self: flex-start;
    margin-right: auto;
}

.message-input form {
    display: flex;
    gap: 10px;
}

.message-input textarea {
    flex-grow: 1;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 8px;
}

/* Notifications */
.notification-list {
    list-style: none;
    padding: 0;
}

.notification-item {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-item.unread {
    background-color: #fff3cd; /* Light yellow for unread */
    border-color: #ffeeba;
}

.notification-item p {
    margin: 0;
}

.notification-item small {
    color: var(--light-text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }

    header .container {
        flex-direction: column;
    }

    nav ul {
        margin-top: 10px;
        justify-content: center;
    }

    nav ul li {
        margin: 0 10px;
    }

    .messages-container {
        flex-direction: column;
    }

    .conversations-list,
    .message-thread {
        flex: none;
        width: 100%;
    }

    .dashboard-stats,
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

body.fade-in {
    animation: fadeIn 0.5s ease-out;
}

section {
    animation: slideInUp 0.5s ease-out;
}
