:root {
    --primary-color: #A3E635;
    --primary-dark: #84cc16;
    --primary-light: #bef264;
    --bg-color: #ffffff;
    --text-color: #1f2937;
    --sidebar-bg: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.5s ease;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-logo h1 {
    font-size: 28px;
    color: var(--text-color);
    margin-bottom: 5px;
    font-weight: 700;
}

.login-logo p {
    color: #6b7280;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(163, 230, 53, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #ffffff 100%);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.sidebar-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.sidebar-logo h2 {
    font-size: 18px;
    color: var(--text-color);
    font-weight: 700;
}

.sidebar-nav {
    list-style: none;
    padding: 0 10px;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background-color: rgba(163, 230, 53, 0.1);
    color: var(--text-color);
    transform: translateX(5px);
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(163, 230, 53, 0.3);
}

.sidebar-nav i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    background-color: #f9fafb;
}

.topbar {
    background-color: white;
    padding: 16px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.topbar-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    border: 2px solid transparent;
}

.user-profile-btn:hover {
    background-color: #f9fafb;
    border-color: var(--primary-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.user-role {
    font-size: 12px;
    color: #6b7280;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-menu a:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-menu a:last-child {
    border-radius: 0 0 12px 12px;
    color: #dc2626;
    border-top: 1px solid var(--border-color);
}

.dropdown-menu a:hover {
    background-color: #f9fafb;
}

.content {
    padding: 30px;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Card */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ffffff, #f9fafb);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.card-body {
    padding: 24px;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
}

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

.table th {
    font-weight: 600;
    color: #6b7280;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}





.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(163, 230, 53, 0.05);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-success {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(163, 230, 53, 0.3);
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(163, 230, 53, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.close {
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Forum/Chat */
.forum-container {
    max-width: 1000px;
    margin: 0 auto;
}

.chat-container {
    max-width: 900px;
    margin: 0 auto;
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
}

.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: messageSlide 0.3s ease;
}

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

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
}

.chat-message-wrapper {
    max-width: 70%;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.chat-message.user .chat-message-header {
    flex-direction: row-reverse;
}

.chat-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.chat-role {
    font-size: 11px;
    color: #6b7280;
    background-color: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
}

.chat-time {
    font-size: 11px;
    color: #9ca3af;
}

.chat-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    word-wrap: break-word;
}

.chat-message:not(.user) .chat-message-content {
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chat-message.user .chat-message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(163, 230, 53, 0.3);
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: white;
    display: flex;
    gap: 12px;
}

.chat-input-container textarea,
.chat-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    resize: none;
    transition: all 0.3s ease;
}

.chat-input-container textarea:focus,
.chat-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.1);
}

/* Resource/Announcement Items */
.resource-item,
.announcement-item {
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.resource-item:hover,
.announcement-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resource-info h4,
.announcement-item h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 600;
}

.resource-info p,
.announcement-item p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

.resource-actions {
    display: flex;
    gap: 10px;
}

.announcement-date {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

/* Badge */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.badge-success {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-color);
}

.badge-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.badge-qoniqarli {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.badge-yaxshi {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.badge-alo {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

/* Icon Buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* File Input */
.file-input-wrapper {
    margin-bottom: 16px;
}

.file-input-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.file-input-wrapper input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-input-wrapper input[type="file"]:hover {
    border-color: var(--primary-color);
    background-color: rgba(163, 230, 53, 0.05);
}

.file-info {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        width: 260px;
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

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

    .topbar {
        padding: 15px;
    }

    .content {
        padding: 15px;
    }

    .login-card {
        padding: 30px 20px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .chat-message-wrapper {
        max-width: 85%;
    }
}

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

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
