/* Wikipedia uslubidagi dizayn */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    line-height: 1.6;
    color: #202122;
    background-color: #f8f9fa;
}

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

/* Header styles */
.header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #a2a9b1;
    padding: 10px 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.logo h1 a {
    color: #000;
    text-decoration: none;
}

.logo p {
    font-size: 0.9rem;
    color: #54595d;
}

.user-menu {
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-weight: bold;
}

.admin-badge {
    background-color: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
}

.auth-links a {
    color: #3366cc;
    text-decoration: none;
}

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

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-right: 15px;
}

.main-nav a {
    color: #3366cc;
    text-decoration: none;
    font-size: 0.9rem;
}

.search-form {
    display: flex;
}

.search-form input {
    padding: 5px 10px;
    border: 1px solid #a2a9b1;
    border-right: none;
    border-radius: 2px 0 0 2px;
    width: 250px;
}

.search-form button {
    background-color: #3366cc;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 0 2px 2px 0;
    cursor: pointer;
}

/* Auth pages */
.auth-container {
    max-width: 400px;
    margin: 40px auto;
}

.auth-form {
    background-color: white;
    padding: 30px;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

.auth-form h1 {
    margin-bottom: 20px;
    text-align: center;
}

.btn-link {
    color: #3366cc;
    text-decoration: none;
    margin-left: 15px;
}

/* Profile page */
.profile-container {
    margin: 20px 0;
}

.profile-header {
    margin-bottom: 20px;
}

.profile-content {
    display: flex;
    gap: 30px;
}

.profile-sidebar {
    flex: 1;
}

.profile-main {
    flex: 2;
}

.user-card {
    background-color: #f8f9fa;
    padding: 20px;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    text-align: center;
}

.avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #3366cc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    margin: 0 auto 15px;
}

.user-card h2 {
    margin-bottom: 10px;
}

.user-email, .user-role, .user-balance, .user-wallet {
    margin-bottom: 5px;
    color: #54595d;
}

.profile-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
}

.profile-form {
    max-width: 500px;
}

.user-articles {
    margin-top: 15px;
}

.user-article {
    padding: 15px;
    border: 1px solid #eaecf0;
    border-radius: 2px;
    margin-bottom: 10px;
}

.user-article h4 {
    margin-bottom: 5px;
}

.user-article h4 a {
    color: #3366cc;
    text-decoration: none;
}

.article-meta {
    font-size: 0.8rem;
    color: #54595d;
    margin-bottom: 10px;
}

.btn-edit-small {
    background-color: #3366cc;
    color: white;
    padding: 3px 10px;
    text-decoration: none;
    border-radius: 2px;
    font-size: 0.8rem;
}

/* Success message */
.success {
    background-color: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 2px;
    margin-bottom: 20px;
    border-left: 3px solid #28a745;
}

/* Main content */
.main-content {
    background-color: white;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

.welcome-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaecf0;
}

.content-layout {
    display: flex;
    gap: 30px;
}

.main-column {
    flex: 3;
}

.sidebar {
    flex: 1;
    background-color: #f8f9fa;
    padding: 15px;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
}

.sidebar h3 {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eaecf0;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 5px;
}

.category-list a {
    color: #3366cc;
    text-decoration: none;
}

/* Article styles */
.article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaecf0;
}

.article-header h1 {
    font-size: 1.8rem;
    font-weight: normal;
}

.btn-edit {
    background-color: #3366cc;
    color: white;
    padding: 5px 15px;
    text-decoration: none;
    border-radius: 2px;
    font-size: 0.9rem;
}

.article-content {
    font-size: 0.875rem;
    line-height: 1.6;
}

.article-meta {
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 2px;
    color: #54595d;
    font-size: 0.8rem;
}

/* Forms */
.article-form {
    max-width: 800px;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    font-family: inherit;
    font-size: 0.9rem;
}

.form-group small {
    color: #54595d;
    font-size: 0.8rem;
}

.form-actions {
    margin-top: 30px;
}

.btn-submit {
    background-color: #3366cc;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-cancel {
    background-color: #f8f9fa;
    color: #202122;
    padding: 8px 20px;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 10px;
}

.error {
    background-color: #fee7e6;
    color: #b32424;
    padding: 10px 15px;
    border-radius: 2px;
    margin-bottom: 20px;
    border-left: 3px solid #b32424;
}

/* Search results */
.search-form-large {
    display: flex;
    margin: 20px 0;
}

.search-form-large input {
    flex: 1;
    padding: 10px;
    border: 1px solid #a2a9b1;
    border-right: none;
    border-radius: 2px 0 0 2px;
    font-size: 1rem;
}

.search-form-large button {
    background-color: #3366cc;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 0 2px 2px 0;
    cursor: pointer;
    font-size: 1rem;
}

.search-results {
    margin-top: 20px;
}

.search-result {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaecf0;
}

.search-result h3 {
    margin-bottom: 5px;
}

.search-result h3 a {
    color: #3366cc;
    text-decoration: none;
}

/* Article previews */
.article-preview {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaecf0;
}

.article-preview h3 {
    margin-bottom: 5px;
}

.article-preview h3 a {
    color: #3366cc;
    text-decoration: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: #54595d;
    font-size: 0.8rem;
    border-top: 1px solid #a2a9b1;
}

/* Responsive design */
@media (max-width: 768px) {
    .content-layout {
        flex-direction: column;
    }
    
    .profile-content {
        flex-direction: column;
    }
    
    .main-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main-nav ul {
        margin-bottom: 10px;
    }
    
    .search-form input {
        width: 100%;
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-menu {
        margin-top: 10px;
    }
    
    .user-info {
        flex-wrap: wrap;
    }
}


/* CSS faylining oxiriga qo'shing */

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 15px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #28a745;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #dc3545;
}

.avatar-small.placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #3366cc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Form validatsiyasi */
.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input:valid {
    border-color: #28a745;
}


/* Admin sahifalari uchun stillar */
.admin-container {
    margin: 20px 0;
}

.admin-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaecf0;
}

.admin-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    color: #202122;
}

.admin-header p {
    color: #54595d;
    font-size: 1rem;
}

/* Statistikalar */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #a2a9b1;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    margin: 0;
    color: #3366cc;
}

.stat-info p {
    margin: 5px 0 0 0;
    color: #54595d;
    font-size: 0.9rem;
}

/* Admin content layout */
.admin-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* Tezkor amallar */
.quick-actions {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #a2a9b1;
    margin-bottom: 30px;
}

.quick-actions h2 {
    margin-bottom: 20px;
    color: #202122;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #a2a9b1;
    border-radius: 8px;
    text-decoration: none;
    color: #202122;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #3366cc;
    color: white;
    border-color: #3366cc;
    transform: translateY(-2px);
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Top mualliflar */
.top-authors {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #a2a9b1;
}

.top-authors h2 {
    margin-bottom: 20px;
    color: #202122;
}

.authors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.author-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.author-name {
    font-weight: bold;
}

.article-count {
    color: #54595d;
    font-size: 0.9rem;
}

/* Sidebar */
.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.recent-activity {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #a2a9b1;
}

.recent-activity h2 {
    margin-bottom: 20px;
    color: #202122;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.activity-item:hover {
    background: #f8f9fa;
}

.activity-icon {
    font-size: 1.2rem;
}

.activity-info {
    flex: 1;
}

.activity-title {
    margin: 0;
    font-weight: bold;
    font-size: 0.9rem;
}

.activity-time {
    margin: 5px 0 0 0;
    color: #54595d;
    font-size: 0.8rem;
}

/* Admin jadvallari */
.admin-actions {
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eaecf0;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #202122;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

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

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

.btn-delete:hover {
    background: #c82333;
}

/* Formalar */
.admin-article-form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #a2a9b1;
}

.role-form {
    margin: 0;
}

.role-form select {
    padding: 5px;
    border: 1px solid #a2a9b1;
    border-radius: 4px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.article-link {
    color: #3366cc;
    text-decoration: none;
    font-weight: bold;
}

.article-link:hover {
    text-decoration: underline;
}

.no-data {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    border: 1px solid #a2a9b1;
    color: #54595d;
}

/* Responsive design */
@media (max-width: 768px) {
    .admin-content {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
    }
    
    .actions {
        flex-direction: column;
    }
}

/* ============================================
   MOBIL MENYU UCHUN QO'SHIMCHA CSS KODLAR
   ============================================ */

/* Hamburger menyu tugmasi */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1000;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #202122;
    transition: all 0.3s ease;
}

/* Menyu ochiq bo'lganda hamburger animatsiyasi */
.mobile-menu-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobil menyu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobil menyu paneli */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    overflow-y: auto;
    transition: right 0.3s ease;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #a2a9b1;
}

.mobile-menu-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #202122;
}

.mobile-menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #54595d;
}

.mobile-menu-body {
    padding: 20px;
}

.mobile-user-section {
    padding-bottom: 20px;
    border-bottom: 1px solid #eaecf0;
    margin-bottom: 20px;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.mobile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #3366cc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
}

.mobile-username {
    font-weight: bold;
    color: #202122;
}

.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.mobile-nav-links a {
    display: block;
    padding: 12px 15px;
    color: #202122;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mobile-nav-links a:hover {
    background-color: #f8f9fa;
}

.mobile-nav-links .nav-icon {
    margin-right: 10px;
    color: #54595d;
}

.mobile-search-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eaecf0;
}

.mobile-search-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #a2a9b1;
    border-radius: 4px;
    margin-bottom: 10px;
}

.mobile-search-form button {
    width: 100%;
    padding: 10px;
    background-color: #3366cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Responsive dizayn - 768px va undan kichik */
@media (max-width: 768px) {
    /* Hamburger tugmasini ko'rsatish */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Mobil menyuni yoqish */
    .mobile-menu {
        display: block;
    }
    
    /* Desktop navigatsiyani yashirish */
    .main-nav ul {
        display: none;
    }
    
    .main-nav .search-form {
        display: none;
    }
    
    /* Header joylashuvi */
    .header-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .user-menu {
        display: none;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .logo p {
        font-size: 0.75rem;
    }
    
    /* Content layout */
    .content-layout {
        flex-direction: column;
    }
    
    .sidebar {
        order: 2;
    }
    
    .main-column {
        order: 1;
    }
    
    /* Profile sahifa */
    .profile-content {
        flex-direction: column;
    }
    
    .profile-sidebar {
        order: 1;
    }
    
    .profile-main {
        order: 2;
    }
    
    /* Admin sahifa */
    .admin-content {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    /* Jadvallar */
    .admin-table {
        display: block;
        overflow-x: auto;
    }
    
    /* Auth formalar */
    .auth-container {
        margin: 20px 10px;
    }
    
    .auth-form {
        padding: 20px;
    }
    
    /* Main content padding */
    .main-content {
        padding: 15px;
    }
    
    /* Article header */
    .article-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    /* Search form large */
    .search-form-large {
        flex-direction: column;
    }
    
    .search-form-large input,
    .search-form-large button {
        width: 100%;
        border-radius: 4px;
        border: 1px solid #a2a9b1;
    }
    
    .search-form-large button {
        margin-top: 10px;
    }
}

/* Juda kichik ekranlar - 480px va undan kichik */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 1.1rem;
    }
    
    .logo p {
        display: none;
    }
    
    .mobile-menu {
        width: 100%;
        right: -100%;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-submit,
    .btn-cancel {
        width: 100%;
        margin: 5px 0;
    }
    
    .form-actions {
        display: flex;
        flex-direction: column;
    }
}