:root { 
    --primary-color: #fff; 
    --secondary-color: #333; 
    --background-gradient: linear-gradient(135deg, #2b5876, #4e4376); 
    --tag-color: #4a69bd;
    --card-hover-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

* {
    box-sizing: border-box;
}

body, html { 
    margin: 0; 
    padding: 0; 
    width: 100%; 
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; 
    background: var(--background-gradient); 
    color: var(--primary-color);
    overflow-x: hidden;
}

.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background-color: rgba(0, 0, 0, 0.6); 
    color: white; 
    padding: 0.75rem 1rem; 
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.brand-title a { 
    font-size: 1.5rem; 
    color: white; 
    text-decoration: none; 
    transition: transform 0.2s;
    display: inline-block;
}

.brand-title a:hover {
    transform: scale(1.1);
}

.navbar-links ul { 
    margin: 0; 
    padding: 0; 
    display: flex; 
    list-style: none; 
    gap: 0;
}

.navbar-links li a { 
    text-decoration: none; 
    color: white; 
    padding: 0.75rem 1rem; 
    display: block; 
    transition: background-color 0.2s;
    white-space: nowrap;
}

.navbar-links li a:hover { 
    background-color: rgba(255, 255, 255, 0.1); 
    border-radius: 5px;
}

.toggle-button { 
    position: absolute; 
    top: 0.75rem; 
    right: 1rem; 
    display: none; 
    flex-direction: column; 
    justify-content: space-between; 
    width: 30px; 
    height: 21px; 
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.toggle-button .bar { 
    height: 3px; 
    width: 100%; 
    background-color: white; 
    border-radius: 10px; 
    transition: all 0.3s;
}

.search-container { 
    flex-grow: 1; 
    display: flex; 
    justify-content: center; 
    padding: 0 20px; 
    position: relative; 
    max-width: 500px;
    margin: 0 auto;
}

#search-form { 
    display: flex; 
    width: 100%; 
    background-color: rgba(255, 255, 255, 0.2); 
    border-radius: 25px; 
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

#search-form:focus-within {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

#search-input { 
    flex-grow: 1; 
    border: none; 
    background: transparent; 
    padding: 12px 18px; 
    color: white; 
    font-size: 1rem; 
    outline: none;
    width: 0;
}

#search-input::placeholder { 
    color: rgba(255, 255, 255, 0.7); 
}

#search-form button { 
    border: none; 
    background: transparent; 
    color: white; 
    padding: 0 18px; 
    cursor: pointer; 
    font-size: 1rem;
    transition: transform 0.2s;
}

#search-form button:hover {
    transform: scale(1.1);
}

#suggestions-box { 
    display: none; 
    position: absolute; 
    top: 100%; 
    left: 0; 
    right: 0; 
    background-color: rgba(62, 61, 90, 0.95); 
    backdrop-filter: blur(10px);
    border-radius: 0 0 12px 12px; 
    z-index: 100; 
    max-height: 250px; 
    overflow-y: auto; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    margin-top: 5px;
}

#suggestions-box::-webkit-scrollbar {
    width: 6px;
}

#suggestions-box::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.suggestion-item { 
    padding: 12px 18px; 
    color: white; 
    cursor: pointer; 
    transition: background-color 0.2s;
}

.suggestion-item:hover { 
    background-color: rgba(78, 67, 118, 0.8); 
}

.content-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 20px; 
    padding: 20px; 
    max-width: 1400px;
    margin: 0 auto;
}

.grid-item { 
    background-color: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 15px; 
    overflow: hidden; 
    transition: all 0.3s ease; 
    backdrop-filter: blur(10px); 
    display: flex; 
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.grid-item:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--card-hover-shadow); 
    border-color: rgba(255, 255, 255, 0.4);
}

.image-scroller { 
    display: flex; 
    overflow-x: auto; 
    height: 220px; 
    background-color: rgba(0,0,0,0.2); 
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.4) transparent;
}

.image-scroller::-webkit-scrollbar { 
    height: 8px; 
}

.image-scroller::-webkit-scrollbar-track { 
    background: rgba(0,0,0,0.2); 
}

.image-scroller::-webkit-scrollbar-thumb { 
    background: rgba(255,255,255,0.4); 
    border-radius: 4px; 
}

.image-scroller img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    flex-shrink: 0; 
    scroll-snap-align: start; 
    cursor: pointer;
    transition: transform 0.3s;
}

.image-scroller img:hover {
    transform: scale(1.05);
}

.image-scroller .placeholder-img { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 100%; 
    height: 100%; 
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
}

.grid-item .item-content { 
    padding: 18px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
}

.item-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 12px; 
    gap: 10px; 
}

.item-title { 
    flex-grow: 1; 
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.language-tag { 
    background-color: rgba(0,0,0,0.3); 
    color: #fff; 
    padding: 4px 10px; 
    font-size: 0.75rem; 
    border-radius: 12px; 
    white-space: nowrap; 
    flex-shrink: 0;
}

.tags-container { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 6px; 
    margin-bottom: 12px; 
}

.tag { 
    background-color: var(--tag-color); 
    color: #fff; 
    padding: 4px 10px; 
    font-size: 0.75rem; 
    border-radius: 10px;
    display: inline-block;
}

.pdf-links { 
    margin-top: 12px; 
}

.pdf-link { 
    text-decoration: none; 
    color: var(--primary-color); 
    padding: 10px 0; 
    display: block; 
    background-color: transparent;
    transition: padding-left 0.2s;
}

.pdf-link:hover {
    padding-left: 5px;
}

.icon-text { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.icon-text i { 
    font-size: 1.3rem; 
}

.icon-text span { 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    flex: 1;
}

.placeholder-text { 
    text-align: center; 
    grid-column: 1 / -1; 
    font-size: 1.2rem; 
    color: rgba(255,255,255,0.7); 
    padding: 4rem 1rem;
}

.modal-viewer { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    padding-top: 50px; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.95); 
    text-align: center;
    backdrop-filter: blur(5px);
}

.modal-content { 
    margin: auto; 
    display: block; 
    width: 90%; 
    max-width: 900px;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.close-viewer, .close-viewer-qr { 
    position: absolute; 
    top: 20px; 
    right: 40px; 
    color: #f1f1f1; 
    font-size: 45px; 
    font-weight: bold; 
    transition: all 0.3s; 
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
}

.close-viewer:hover, .close-viewer-qr:hover {
    color: #fff;
    transform: scale(1.2);
}

#qr-viewer h2 { 
    color: #fff;
    margin-top: 20px;
} 

#qrcode { 
    background-color: white; 
    padding: 20px; 
    display: inline-block; 
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.item-actions { 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    gap: 15px; 
    margin: 15px 0; 
    padding-top: 15px; 
    border-top: 1px solid rgba(255,255,255,0.2); 
}

.item-actions .action-group { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.item-actions button { 
    background: none; 
    border: none; 
    color: #fff; 
    cursor: pointer; 
    font-size: 1.2rem; 
    opacity: 0.8; 
    transition: all 0.2s;
    padding: 5px;
    border-radius: 5px;
}

.item-actions button:hover { 
    opacity: 1;
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

.item-actions button:active {
    transform: scale(0.95);
}

.item-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.item-actions button:disabled:hover {
    transform: none;
    background: none;
}

.item-actions span { 
    min-width: 20px; 
    text-align: center; 
    font-weight: bold;
    font-size: 0.95rem;
}

.comments-section { 
    margin-top: 12px; 
    text-align: left; 
    max-height: 250px; 
    overflow-y: auto; 
    padding-right: 8px;
}

.comments-section::-webkit-scrollbar {
    width: 6px;
}

.comments-section::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.comment { 
    background: rgba(0,0,0,0.2); 
    padding: 10px; 
    border-radius: 8px; 
    margin-bottom: 10px; 
    font-size: 0.9rem;
    word-wrap: break-word;
}

.comment small { 
    display: block; 
    opacity: 0.7; 
    font-size: 0.75rem;
    margin-top: 5px;
}

.comment-form { 
    display: flex; 
    gap: 8px; 
    margin-top: 12px; 
}

.comment-form input { 
    flex-grow: 1; 
    background: rgba(0,0,0,0.3); 
    border: 1px solid rgba(255,255,255,0.3); 
    color: #fff; 
    padding: 10px 12px; 
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.comment-form input:focus {
    border-color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.4);
}

.comment-form button { 
    background: rgba(255,255,255,0.2); 
    border: none; 
    color: #fff; 
    padding: 10px 15px; 
    border-radius: 8px; 
    cursor: pointer;
    transition: all 0.2s;
}

.comment-form button:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) { 
    .toggle-button { 
        display: flex; 
    }
    
    .navbar-links { 
        display: none; 
        width: 100%; 
    }
    
    .navbar { 
        flex-direction: column; 
        align-items: flex-start; 
        padding: 0.75rem;
    }
    
    .navbar-links ul { 
        width: 100%; 
        flex-direction: column; 
    }
    
    .navbar-links li { 
        text-align: left; 
        width: 100%;
    }
    
    .navbar-links li a { 
        padding: 0.75rem 1rem; 
        width: 100%;
    }
    
    .navbar-links.active { 
        display: flex; 
    }
    
    .search-container { 
        order: 3; 
        width: 100%; 
        padding: 10px 0 5px 0;
        max-width: 100%;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .grid-item {
        border-radius: 12px;
    }
    
    .image-scroller {
        height: 200px;
    }
    
    .grid-item .item-content {
        padding: 15px;
    }
    
    .item-title {
        font-size: 1rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .close-viewer, .close-viewer-qr {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
    
    .item-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .content-grid {
        padding: 10px;
        gap: 12px;
    }
    
    .image-scroller {
        height: 180px;
    }
    
    .grid-item .item-content {
        padding: 12px;
    }
    
    .item-title {
        font-size: 0.95rem;
    }
    
    .tags-container {
        gap: 4px;
    }
    
    .tag {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .item-actions button {
        min-width: 44px;
        min-height: 44px;
    }
    
    .comment-form button {
        min-width: 44px;
        min-height: 44px;
    }
    
    .suggestion-item {
        padding: 15px 18px;
    }
}