/* Historical Library Styles - Arken Cultural Heritage Platform */

/* ============================================================================
   TOP NAVIGATION BAR
   ============================================================================ */

.social-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #2c1810 0%, #3d2817 50%, #5a3a25 100%);
    position: relative;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(30, 20, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 99, 76, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 20px rgba(139, 99, 76, 0.6);
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(45, 35, 25, 0.6);
    border: 1px solid rgba(139, 99, 76, 0.4);
    border-radius: 25px;
    padding: 8px 16px;
    max-width: 400px;
    flex: 1;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 14px;
    width: 100%;
    padding: 0 10px;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-bar button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    transition: all 0.2s ease;
}

.search-bar button:hover {
    color: #d4a574;
    transform: scale(1.1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle,
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: rgba(139, 99, 76, 0.2);
    border: 1px solid rgba(139, 99, 76, 0.4);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
}

.mobile-menu-toggle:hover,
.mobile-menu-btn:hover {
    background: rgba(139, 99, 76, 0.3);
    border-color: rgba(139, 99, 76, 0.6);
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: #d4a574;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1),
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2),
.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3),
.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    background: rgba(139, 99, 76, 0.2);
    border: 1px solid rgba(139, 99, 76, 0.4);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    padding: 10px 14px;
    font-size: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-btn:hover {
    background: rgba(139, 99, 76, 0.3);
    border-color: rgba(139, 99, 76, 0.6);
    transform: translateY(-2px);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #c9302c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(139, 99, 76, 0.5);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(45, 35, 25, 0.8);
    padding: 0;
}

.user-avatar:hover {
    border-color: #d4a574;
    box-shadow: 0 0 20px rgba(212, 165, 116, 0.4);
    transform: scale(1.05);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(30, 20, 15, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 99, 76, 0.4);
    border-radius: 12px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown .dropdown-item {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.user-dropdown .dropdown-item:hover {
    background: rgba(139, 99, 76, 0.3);
    padding-left: 24px;
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid rgba(139, 99, 76, 0.3);
    margin: 8px 0;
}

.user-dropdown .logout-btn {
    color: #ef4444;
}

/* ============================================================================
   MAIN CONTENT AREA
   ============================================================================ */

.main-content {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    background: linear-gradient(135deg, #f5f1ed 0%, #ebe5df 100%);
}

/* ============================================================================
   MOBILE NAVIGATION (Hamburger Menu)
   ============================================================================ */

.desktop-nav-container {
    width: 280px;
    background: linear-gradient(135deg, rgba(45, 35, 25, 0.9) 0%, rgba(30, 20, 15, 0.9) 100%);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    border-right: 1.5px solid rgba(139, 99, 76, 0.4);
}

@media (max-width: 768px) {
    .desktop-nav-container {
        display: none;
    }
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: 100%;
    background: rgba(139, 99, 76, 0.1);
    backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(139, 99, 76, 0.2);
}

.sidebar-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sidebar-header-nav h2 {
    background: linear-gradient(135deg, #d4a574 0%, #f5d9b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
    font-weight: 300;
    margin: 0;
}

.mobile-menu-section {
    margin-bottom: 10px;
}

.mobile-menu-section h4 {
    color: rgba(212, 165, 116, 0.7);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 16px;
}

.mobile-menu-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-size: 15px;
}

.mobile-menu-item:hover {
    background: rgba(139, 99, 76, 0.2);
    border-color: rgba(139, 99, 76, 0.3);
    transform: translateX(4px);
}

.mobile-menu-item.active {
    background: rgba(139, 99, 76, 0.3);
    color: white;
    font-weight: 600;
    border-color: rgba(139, 99, 76, 0.4);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.menu-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.menu-text {
    font-size: 15px;
}

.user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(139, 99, 76, 0.15);
    border-radius: 12px;
    margin-top: auto;
    border: 1px solid rgba(139, 99, 76, 0.2);
}

.user-avatar-sidebar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info-text h4 {
    margin: 0;
    color: white;
    font-size: 15px;
    font-weight: 600;
}

.user-info-text p {
    margin: 4px 0 0 0;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.mobile-close-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 998;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Responsive Mobile Menu */
@media (max-width: 768px) {
    .search-bar {
        display: none;
    }
    
    .mobile-menu-toggle,
    .mobile-menu-btn {
        display: flex;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .nav-left {
        gap: 10px;
    }

    .mobile-close-btn {
        display: block;
    }

    .desktop-nav-container {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 999;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    .desktop-nav-container.active {
        display: flex;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 20px;
    }
}

/* ============================================================================
   HISTORY HEADER
   ============================================================================ */

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 24px 24px;
    border-bottom: 1px solid #d4c4b4;
    background: #ffffff;
}

.header-content h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #3d2817;
}

.header-subtitle {
    font-size: 15px;
    color: #8b634c;
    margin: 0;
}

.btn-create-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #8b634c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(139, 99, 76, 0.3);
}

.btn-create-entry:hover {
    background: #6d4a36;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 99, 76, 0.4);
}

.btn-create-entry:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 18px;
}

/* ============================================================================
   FILTER SECTION
   ============================================================================ */

.filter-section {
    padding: 16px 24px;
    background: #f5ebe0;
    border-bottom: 1px solid #d4c4b4;
    overflow-x: auto;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    min-width: max-content;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid transparent;
    border-radius: 20px;
    background: #ffffff;
    color: #8b634c;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #ebe5df;
}

.filter-btn.active {
    background: #8b634c;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(139, 99, 76, 0.3);
}

/* ============================================================================
   VIEW TOGGLE
   ============================================================================ */

.view-toggle {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    background: #ffffff;
    border-bottom: 1px solid #d4c4b4;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid #d4c4b4;
    border-radius: 8px;
    background: transparent;
    color: #8b634c;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #f5ebe0;
}

.view-btn.active {
    background: #8b634c;
    color: white;
    border-color: #8b634c;
}

/* ============================================================================
   HISTORY GRID & CARDS
   ============================================================================ */

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.history-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e8dfd4;
    border-left: 4px solid #8b634c;
}

.history-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-left-color: #d4a574;
}

.history-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #f5ebe0 0%, #ebe5df 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: #8b634c;
    position: relative;
    overflow: hidden;
}

.history-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-period {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.history-content {
    padding: 20px;
}

.history-category {
    display: inline-block;
    padding: 4px 12px;
    background: #f5ebe0;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: #8b634c;
    text-transform: capitalize;
    margin-bottom: 10px;
}

.history-category.events {
    background: #fff4e6;
    color: #d4a574;
}

.history-category.people {
    background: #e8f5e9;
    color: #6d8b4a;
}

.history-category.culture {
    background: #f3e5f5;
    color: #9c6bb0;
}

.history-category.traditions {
    background: #e3f2fd;
    color: #4a7ba7;
}

.history-category.landmarks {
    background: #fff3e0;
    color: #c97a3e;
}

.history-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #3d2817;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-excerpt {
    font-size: 14px;
    color: #6d5746;
    margin-bottom: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-footer {
    padding-top: 14px;
    border-top: 1px solid #e8dfd4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #8b634c;
}

.history-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e8dfd4;
}

.history-date {
    font-size: 12px;
    color: #a08977;
}

/* ============================================================================
   LOADING & EMPTY STATES
   ============================================================================ */

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #8b634c;
}

.empty-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    color: #3d2817;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.empty-state p {
    margin: 0 0 24px 0;
    font-size: 16px;
    color: #8b634c;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8dfd4;
    border-top-color: #8b634c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: #8b634c;
    font-size: 15px;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 32px 24px;
    margin-top: 20px;
}

.pagination button {
    padding: 10px 20px;
    border: 1px solid #d4c4b4;
    border-radius: 8px;
    background: #ffffff;
    color: #3d2817;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #f5ebe0;
    border-color: #8b634c;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#page-info {
    font-size: 15px;
    color: #8b634c;
    font-weight: 500;
}

/* ============================================================================
   MODAL STYLES
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e8dfd4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 1;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #3d2817;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #8b634c;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f5ebe0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e8dfd4;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: #ffffff;
}

/* ============================================================================
   FORM STYLES
   ============================================================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #3d2817;
}

.form-group label::after {
    content: ' *';
    color: #c9302c;
}

.form-group label.optional::after {
    content: '';
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d4c4b4;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8b634c;
    box-shadow: 0 0 0 2px rgba(139, 99, 76, 0.1);
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #8b634c;
    font-size: 13px;
}

.form-group input[type="file"] {
    padding: 8px;
    cursor: pointer;
    background: white;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn-primary,
.btn-secondary {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #8b634c;
    color: #ffffff;
}

.btn-primary:hover {
    background: #6d4a36;
}

.btn-primary:active {
    background: #5a3a25;
    transform: scale(0.98);
}

.btn-secondary {
    background: #e8dfd4;
    color: #3d2817;
}

.btn-secondary:hover {
    background: #d4c4b4;
}

.btn-secondary:active {
    background: #c9b9a4;
    transform: scale(0.98);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 16px;
    }

    .header-content h1 {
        font-size: 24px;
    }

    .btn-create-entry {
        width: 100%;
        justify-content: center;
    }

    .filter-section {
        padding: 12px 16px;
    }

    .view-toggle {
        padding: 12px 16px;
    }

    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
        padding: 16px;
    }

    .history-image {
        height: 180px;
        font-size: 48px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .history-grid {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        gap: 6px;
    }

    .filter-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
}

/* ============================================================================
   NOTIFICATION ANIMATIONS
   ============================================================================ */

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
/* Desktop Floating Sidebar */
.desktop-only {
    display: none;
}
@media (min-width: 769px) {
    #mobile-menu{
        display: none !important;
    }

    .desktop-only {
        display: block !important;
        position: fixed;
        left: 20px;
        top: 100px;
        width: 230px;
        z-index: 100;
        border-radius:12px;
    }
    
    /* Adjust main content to make room for sidebar */
    .main-content {
        margin-left: 290px;
    }
}
