* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* Login Screen */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: var(--white);
    padding: 60px 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 450px;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: white;
}

.login-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-container p {
    color: var(--gray);
    margin-bottom: 30px;
    font-size: 16px;
}

.google-btn {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.google-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.domain-info {
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray);
}

.error-message {
    margin-top: 20px;
    padding: 12px;
    background: #fee2e2;
    color: var(--danger);
    border-radius: 8px;
    font-size: 14px;
}

/* App Container */
.app-container {
    display: none;
    height: 100vh;
    background: var(--light-gray);
    position: relative;
}

.app-container.active {
    display: flex;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 101;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Notification Button */
.notification-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 101;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Notifications Panel */
.notifications-panel {
    position: fixed;
    top: 70px;
    right: 15px;
    width: 350px;
    max-height: 500px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.notifications-panel.active {
    display: flex;
    animation: slideDown 0.3s ease;
}

.notifications-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    font-size: 18px;
    color: var(--dark);
}

.notifications-header button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s;
}

.notifications-header button:hover {
    transform: scale(1.1);
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.notification-item {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--light-gray);
}

.notification-item.unread {
    background: #eef2ff;
}

.notification-item i {
    font-size: 20px;
    color: var(--primary);
    margin-top: 2px;
}

.notification-content {
    flex: 1;
}

.notification-content p {
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 4px;
}

.notification-content span {
    font-size: 11px;
    color: var(--gray);
}

.notification-item button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.notification-item button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.sidebar-header i {
    font-size: 28px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 15px;
}

.nav-item i {
    font-size: 20px;
    width: 24px;
}

.nav-item:hover {
    background: var(--light-gray);
    color: var(--primary);
}

.nav-item.active {
    background: linear-gradient(90deg, #eef2ff 0%, #f5f3ff 100%);
    color: var(--primary);
    border-right: 3px solid var(--primary);
    position: relative;
}

.chat-badge {
    position: absolute;
    right: 20px;
    background: var(--danger);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    display: none;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.user-info img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-status {
    font-size: 12px;
    color: var(--success);
}

.logout-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: #fee2e2;
    color: var(--danger);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 28px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.admin-btn, .primary-btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-btn:hover, .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* News Feed */
.news-feed {
    display: grid;
    gap: 20px;
}

.news-item {
    background: var(--white);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.news-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.news-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.news-meta {
    flex: 1;
}

.news-meta h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.news-meta span {
    font-size: 12px;
    color: var(--gray);
}

.news-content h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--dark);
}

.news-content p {
    color: var(--gray);
    line-height: 1.6;
}

.delete-btn {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.delete-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.05);
}

/* Chat Container */
.chat-container {
    background: var(--white);
    border-radius: 16px;
    height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    position: relative;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 70%;
    position: relative;
}

.message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.message-avatar:hover {
    transform: scale(1.1);
}

.message-content {
    flex: 1;
    position: relative;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-sender {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.message-time {
    font-size: 11px;
    color: var(--gray);
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--light-gray);
    color: var(--dark);
    word-wrap: break-word;
    position: relative;
}

.message.own .message-bubble {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

.message-bubble p {
    margin: 0;
}

/* Message Actions */
.message-actions {
    position: absolute;
    top: -35px;
    right: 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 4px;
    display: none;
    gap: 4px;
    z-index: 10;
    animation: slideDown 0.2s ease;
}

.message.own .message-actions {
    right: 0;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: var(--light-gray);
    color: var(--dark);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Message Reactions */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.reaction {
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
}

.message.own .reaction {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.reaction:hover {
    transform: scale(1.1);
}

.reaction.reacted {
    background: #dbeafe;
    border-color: var(--primary);
}

.message.own .reaction.reacted {
    background: rgba(255, 255, 255, 0.4);
}

/* Reaction Picker */
.reaction-picker {
    position: fixed;
    background: var(--white);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    gap: 4px;
    animation: scaleIn 0.2s ease;
}

.reaction-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.reaction-btn:hover {
    background: var(--light-gray);
    transform: scale(1.2);
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 70px;
    left: 20px;
    background: var(--white);
    border-radius: 12px;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 320px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    animation: slideUp 0.2s ease;
}

.emoji-btn-small {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.emoji-btn-small:hover {
    background: var(--light-gray);
    transform: scale(1.2);
}

/* Fixed Input Box */
.input-box-fixed {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    background: var(--white);
}

.attach-btn, .emoji-btn {
    width: 40px;
    height: 50px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: var(--white);
    color: var(--gray);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.attach-btn:hover, .emoji-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.input-box-fixed input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.input-box-fixed input:focus {
    border-color: var(--primary);
}

.input-box-fixed button:last-child {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.input-box-fixed button:last-child:hover {
    transform: scale(1.05);
}

/* Online Count */
.online-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #dcfce7;
    color: var(--success);
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.online-count i {
    animation: pulse 2s infinite;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    cursor: pointer;
}

.gallery-caption {
    padding: 16px;
    position: relative;
}

.gallery-caption h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.gallery-caption p {
    font-size: 12px;
    color: var(--gray);
}

.delete-gallery-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #fee2e2;
    color: var(--danger);
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.delete-gallery-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.05);
}

/* Direct Messages */
.dm-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    height: calc(100vh - 130px);
}

.users-panel {
    background: var(--white);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    height: 100%;
    max-height: calc(100vh - 130px);
}

.search-box {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.search-box i {
    color: var(--gray);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
}

.users-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.user-item {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.user-item:hover {
    background: var(--light-gray);
}

.user-item.active {
    background: linear-gradient(90deg, #eef2ff 0%, #f5f3ff 100%);
}

.user-item-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.user-item-avatar-wrapper img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: block;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: var(--success);
    border: 2px solid var(--white);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.user-item-info {
    flex: 1;
    min-width: 0;
}

.user-item-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-item-info p {
    font-size: 12px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-panel {
    background: var(--white);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    position: relative;
    height: 100%;
    max-height: calc(100vh - 130px);
}

.chat-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chat-panel-header .back-btn {
    background: var(--light-gray);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--dark);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-panel-header .back-btn:hover {
    background: var(--primary);
    color: white;
}

.chat-panel-header .user-item-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.chat-panel-header .user-item-avatar-wrapper img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.chat-panel-header img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Profile Section */
.profile-container {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.profile-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 600px;
}

.profile-avatar-container {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.profile-avatar-container img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--primary);
}

.avatar-upload {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-upload:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.form-group input {
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group textarea {
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-group input:read-only {
    background: var(--light-gray);
    cursor: not-allowed;
}

.form-group small {
    font-size: 12px;
    color: var(--gray);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--dark);
}

.user-profile-card {
    text-align: center;
    padding: 40px 30px;
    max-width: 500px;
}

.user-profile-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 4px solid var(--primary);
}

.user-profile-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--dark);
}

.user-profile-card p {
    color: var(--gray);
    font-size: 14px;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.profile-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--light-gray);
    border-radius: 10px;
}

.profile-detail-item i {
    font-size: 20px;
    color: var(--primary);
    margin-top: 2px;
}

.profile-detail-item > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
}

.detail-value {
    font-size: 15px;
    color: var(--dark);
    word-break: break-word;
}

.post-modal h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--dark);
}

.post-modal input,
.post-modal textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    margin-bottom: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.post-modal input:focus,
.post-modal textarea:focus {
    border-color: var(--primary);
}

.post-modal textarea {
    min-height: 120px;
    resize: vertical;
}

/* Image Preview Modal */
.image-preview-content {
    max-width: 90vw;
    max-height: 90vh;
    padding: 20px;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
}

/* Message Edit Indicator */
.message-edited {
    font-size: 10px;
    color: var(--gray);
    font-style: italic;
    margin-left: 8px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Content State */
.no-content {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.no-content i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-content p {
    font-size: 16px;
}

/* Private Chats Section */
.private-chats-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    height: calc(100vh - 130px);
    min-height: 500px;
}

.chats-list-panel {
    background: var(--white);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    height: 100%;
    max-height: calc(100vh - 130px);
    overflow: hidden;
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.chat-item {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.chat-item:hover {
    background: var(--light-gray);
}

.chat-item.unread {
    background: #eff6ff;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-item-header h4 {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 11px;
    color: var(--gray);
    flex-shrink: 0;
}

.chat-item-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.chat-item-preview p {
    font-size: 13px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.unread-badge {
    background: var(--primary);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.action-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--light-gray);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
}

.action-icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* Students Section */
.students-filter {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: var(--white);
    color: var(--gray);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.student-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.student-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.student-card-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.student-card-header .user-item-avatar-wrapper img {
    width: 80px;
    height: 80px;
    cursor: pointer;
}

.online-badge {
    background: #dcfce7;
    color: var(--success);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.online-badge i {
    font-size: 8px;
}

.student-card-body {
    padding: 16px 24px;
    flex: 1;
}

.student-card-body h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--dark);
}

.student-email {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
}

.student-year {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.student-bio {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.5;
    display: -webkit-box;

    -webkit-line-clamp: 2;
    line-clamp: 2;


    -webkit-box-orient: vertical;
    overflow: hidden;
}

.student-card-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.student-card-footer button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.secondary-btn {
    background: var(--light-gray);
    color: var(--dark);
}

.secondary-btn:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .dm-container {
        grid-template-columns: 280px 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .notifications-panel {
        width: 320px;
    }
}

@media (max-width: 768px) {
    body {
        background: var(--light-gray);
    }
    
    .login-container {
        padding: 40px 20px;
    }
    
    .login-container h1 {
        font-size: 26px;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
        width: 280px;
    }
    
    .sidebar.mobile-open {
        left: 0;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .mobile-overlay.active {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .notification-btn {
        right: 20px;
    }

    .notifications-panel {
        width: calc(100vw - 30px);
        right: 15px;
        left: 15px;
        max-height: 60vh;
    }
    
    .main-content {
        padding: 15px;
        width: 100%;
        padding-top: 70px;
    }
    
    .section-header {
        flex-direction: row;
        align-content: center;
        align-items: center;
        gap: 12px;
    }
    
    .section-header h2 {
        padding-left: 10px;
        flex: 1;
        font-size: 18px;
    }
    
    .chat-container {
        height: calc(100vh - 200px);
        border-radius: 12px;
    }
    
    .messages-area {
        padding: 16px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-bubble {
        font-size: 14px;
        padding: 10px 14px;
    }

    .message-image {
        max-width: 200px;
        max-height: 200px;
    }

    .message-actions {
        top: -40px;
        right: -10px;
    }

    .emoji-picker {
        max-width: 280px;
        grid-template-columns: repeat(6, 1fr);
    }
    
    .input-box-fixed {
        padding: 12px 16px;
        gap: 6px;
    }

    .attach-btn, .emoji-btn {
        width: 36px;
        height: 45px;
        font-size: 16px;
    }
    
    .input-box-fixed input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .input-box-fixed button:last-child {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .dm-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 250px);
    }
    
    .users-panel {
        display: flex;
    }
    
    .chat-panel {
        display: none;
        border-radius: 12px;
    }
    
    .chat-panel.active {
        display: flex;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .news-item {
        padding: 16px;
    }
    
    .news-content h3 {
        font-size: 18px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .user-profile-card {
        padding: 30px 20px;
    }
    
    .user-profile-card img {
        width: 100px;
        height: 100px;
    }
    
    .profile-container {
        padding: 20px 0;
    }
    
    .profile-card {
        padding: 24px 20px;
    }
    
    .profile-avatar-container img {
        width: 120px;
        height: 120px;
    }
    
    .online-count {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .admin-btn, .primary-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .delete-btn, .delete-gallery-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .message-content {
        width: 100%;
    }

    .reaction-picker {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
        padding-top: 70px;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    .chat-container {
        height: calc(100vh - 200px);
    }
    
    .dm-container {
        height: calc(100vh - 140px);
    }

    .users-panel {
        max-height: calc(100vh - 140px);
    }

    .chat-panel {
        max-height: calc(100vh - 140px);
    }
    
    .message {
        max-width: 90%;
    }

    .message-image {
        max-width: 180px;
        max-height: 180px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item img {
        height: 220px;
    }
    
    .user-item {
        padding: 12px 16px;
    }
    
    .user-item-avatar-wrapper img {
        width: 45px;
        height: 45px;
    }

    .online-indicator {
        width: 12px;
        height: 12px;
    }
    
    .profile-avatar-container img {
        width: 100px;
        height: 100px;
    }
    
    .avatar-upload {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .notifications-panel {
        max-height: 50vh;
    }

    .emoji-picker {
        max-width: 260px;
        grid-template-columns: repeat(5, 1fr);
    }

    .input-box-fixed {
        padding: 10px 12px;
    }

    .attach-btn, .emoji-btn {
        width: 34px;
        height: 42px;
    }

    .input-box-fixed button:last-child {
        width: 42px;
        height: 42px;
    }

    .message-actions {
        gap: 2px;
        padding: 3px;
    }

    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .reaction {
        font-size: 12px;
        padding: 3px 6px;
    }

    .private-chats-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 160px);
    }

    .chats-list-panel {
        display: flex;
        max-height: calc(100vh - 160px);
    }

    .students-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .student-card-header .user-item-avatar-wrapper img {
        width: 60px;
        height: 60px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}