/* Homepage Styles */
body{
    background-color: #f0f1f2;
}
.login-icon{
    height: 30px;
    margin-right: 10px; 
    
}
.login-text{
    font-size: 16px;
    font-weight: 500;
    text-align: justify;
    margin-bottom: 10px;
    display: inline-block;
    color: #292a2a !important;
    
}
/* Right Sidebar Styles (appears on left visually in RTL) */
.right-sidebar {
    width: 340px;
    min-width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: stretch; /* Ensure sidebar stretches to full height */
    min-height: 100%; /* At least full height */
    background-color: #fff;
    position: relative; /* Create positioning context */
    z-index: 200; /* Higher than grid items to prevent overlap */
}

/* Filter Widget Container - Fixed Position */
#filterForm {
    width:100%;
    padding:0;
    margin:0;
    border: none;
}

.filter-widget-container {
    position: sticky;
    top: 20px;
    z-index: 201; /* Higher than sidebar to ensure it stays on top */
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: #fff; /* Ensure solid background */
}

.filter-nav-container {
    border-bottom: 2px solid #f0f1f2;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 15px;
}

.filter-nav-container nav {
    margin-bottom: 0;
    flex: 1;
}

/* Filter Cart Container Styles */
.filter-cart-container {
    flex-shrink: 0;
    position: relative;
}

.filter-cart-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.filter-cart-link:hover {
    background-color: #f5f5f5;
}

.filter-cart-link.active {
    background-color: #0066cc;
    color: white;
}

.filter-cart-container .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none; /* Hidden by default, shown by JavaScript when count > 0 */
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* Tab Navigation Styles */
.filter-tabs-nav {
    display: flex;
    border-bottom: 2px solid #f0f1f2;
    background-color: #fff;
}

.filter-tab-btn {
    flex: 1;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border: none;
    border-left: 1px solid #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
    font-family: "Open Sans", Arial, sans-serif;
    position: relative;
}

.filter-tab-btn:first-child {
    border-left: none;
}

.filter-tab-btn:hover {
    background-color: #e9ecef;
    color: #333;
}

.filter-tab-btn.active {
    background-color: #fff;
    color: #0066cc;
    border-bottom: 3px solid #0066cc;
}

.cart-tab-count {
    display: none;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 5px;
    min-width: 18px;
    text-align: center;
}

.filter-tab-btn.active .cart-tab-count {
    background: #0066cc;
}

/* Tab Content Styles */
.filter-tab-content {
    display: none;
}

.filter-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Cart Tab Styles */
.cart-tab-content {
    padding: 15px;
    min-height: 200px;
}

.cart-empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.cart-empty-message p {
    font-size: 16px;
    margin: 0;
}

.cart-items-wrapper {
    display: flex;
    flex-direction: column;
}

.cart-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.cart-tab-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.btn-clear-cart-small {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: "Open Sans", Arial, sans-serif;
}

.btn-clear-cart-small:hover {
    background: #c82333;
}

.cart-items-list-tab {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item-tab {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    gap: 10px;
    transition: background-color 0.2s ease;
}

.cart-item-tab:hover {
    background-color: #f8f9fa;
}

.cart-item-tab:last-child {
    border-bottom: none;
}

.cart-item-number-tab {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: #0066cc;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.cart-item-name-tab {
    flex: 1;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    text-align: right;
}

.cart-item-remove-tab {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.cart-item-remove-tab:hover {
    background: #c82333;
    transform: scale(1.1);
}

.cart-tab-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.btn-download-all-tab {
    width: 100%;
    padding-top: 12px;
    padding-bottom: 12px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: block;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-download-all-tab:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-print-all-tab {
    width: 100%;
    padding-top: 12px;
    padding-bottom: 12px;
    margin-top: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: block;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-print-all-tab:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-print-all-tab:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.2);
}

/* Filter Widget Styles - Matching Image Design */
.filter-widget {
    background: #fff;
    padding: 20px;
    border-bottom: 2px solid #f0f1f2;
}

.filter-widget form {
    display: flex;
    flex-direction: column;
   /* gap: 15px; */
}

.filter-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin-bottom: 0;
    flex-shrink: 0;
    min-width: 120px;
    text-align: right;
}

.filter-group select,
.filter-group input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #495057;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.filter-submit-btn {
    width: 100%;
    padding: 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 5px;
}

.filter-submit-btn:hover {
    background: #5a6268;
}

.stats-widget {
  /*  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    color: #000;
    padding: 15px; 
    border-bottom: 2px solid #f0f1f2;
  /*  margin-bottom: 15px; */
    display: flex;
    flex-direction: column;
    gap: 12px;
    
}

#current-date {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    color: #292a2a !important;
    font-size: 20px;
    font-weight: 500;
}

.current-date-text {
    flex-shrink: 0;
    
}

.next-holiday-text {
    margin-right: auto;
    
}

.stats-item {
    text-align: right;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}


.stats-number, .stats-date, .stats-time {
   /* font-size: 1.8em; */
    font-weight: bold;
  /*  text-shadow: 0 2px 4px rgba(0,0,0,0.3); */
    flex-shrink: 0;
    color: #f13131 !important;
}

.stats-label {
  /*  font-size: 0.95em;
    opacity: 0.9;
  */
    color: #808382 !important;
    font-weight: 500;
    flex: 1;
    text-align: right;
}
#last-updated {
    display: none;
}

/* Sticky tower banner in right sidebar */
.right-sidebar .ad-tower-banner.ad-tower-left {
    position: sticky;
    z-index: 99;
    margin-top: 0;
    align-self: flex-start; /* Align to top of flex container */
}

/*
.stats-date {
    font-size: 1.1em;
    font-weight: bold;
    margin: 2px 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.stats-time {
    font-size: 0.9em;
    opacity: 0.8;
    font-weight: 400;
}
*/
.grid-container { 
    display: grid; 
    gap: 20px; 
}

.grid-item-wrapper {
    position: relative;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: visible;
    transition: box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    z-index: 1; /* Lower than sidebar to prevent overlap */
    /* Container height will automatically adjust to content */
}

.grid-item-wrapper:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.grid-item { 
    display: flex;
    flex-direction: column;
    padding: 10px; 
    text-align: center; 
    color: black; 
    text-decoration: none;
    margin-top: 0;
    flex: 1;
    /* Make grid-item a flex container to control child positioning */
}

.grid-item img { 
    max-width: 100%; 
    height: auto; 
    margin-bottom: 0; 
    display: block;
    /* Image is the base - other elements overlay it */
}

.grid-item .downloads { 
    font-size: 12px; 
    color: #888; 
    font-weight: bold;
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 5px;
}

.downloads-count {
    font-size: 12px; 
    color: #ee1c25; 
    font-weight: bold;
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}
.alon-title {
    --title-offset: -3em; /* Change this value - margin-bottom will auto-update */
    background-color: #00000080;
  /*  opacity: 0.6;*/
    color: #fff;
    position: relative;
    top: var(--title-offset);
    min-height: 3.5em;
    margin-bottom: var(--title-offset); /* Automatically matches top value */
    z-index: 2; /* Ensure it's above the image */
    display: flex;
    align-items: center;
    justify-content: center;
}

.alon-title h3 {
    margin: 0;
    padding-left: 5px;
    padding-right: 5px;
   /* margin-block-start: 0.5em;*/
   /* margin-block-end: 0.5em;*/
    font-size: 1.2em;
    font-weight: 500;
    color: #fff;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.alon-meta {
    --meta-offset: 1em; /* Change this value - margin-bottom will auto-update */
    position: relative;
    top: var(--meta-offset);
    margin-bottom: var(--meta-offset); /* Automatically matches top value */
    z-index: 1; /* Ensure it's above the image */
}

/* Ensure paragraphs in .alon-meta don't add extra space */
.alon-meta p {
    margin: 0;
    margin-bottom: 0.3em;
}

.alon-meta p:last-child {
    margin-bottom: 0;
}

.share-container {
    display: none;
    position: relative;
    padding: 10px;
    border-top: 1px solid #eee;
}

.share-btn {
    width: 100%;
    background: #17a2b8;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.share-btn:hover {
    background: #138496;
}

.share-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px;
    margin-bottom: 5px;
    z-index: 1000;
    min-width: 180px;
}

.share-dropdown.show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 14px;
}

.share-option:hover {
    background: #f8f9fa;
}

.share-option span {
    font-size: 18px;
}

.share-option.whatsapp:hover {
    background: #e8f5e9;
    color: #25D366;
}

.share-option.facebook:hover {
    background: #e3f2fd;
    color: #1877f2;
}

.share-option.telegram:hover {
    background: #e1f5fe;
    color: #0088cc;
}

.share-option.twitter:hover {
    background: #f3f4f6;
    color: #000;
}

/* Featured section styles */
.featured-section {
    margin: 30px 0;
    padding: 20px;
    background-color: #353535 !important;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.featured-title {
    display: none;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.featured-grid {
    background: transparent;
}

.featured-item .grid-item {
    position: relative;
    background: #f0f1f2;
    border: 3px solid #FFD700;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.featured-item .grid-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.6);
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FFD700;
    color: #000;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.featured-item .file-meta {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.file-category, .file-language {
    padding: 3px 10px;
    background: #f0f0f0;
    border-radius: 10px;
    font-size: 12px;
}

.file-stats {
    display: none;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* Responsive grid for smaller screens */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* PDF Modal Styles */
.pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.pdf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    cursor: pointer;
    opacity: 0.3;
}

.pdf-modal-content {
    position: relative;
    margin: 0 auto;
    width: 50%;
    max-width: 1200px;
    height: 90vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 10001;
}

.pdf-modal-header {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
    border-radius: 8px 8px 0 0;
}

.pdf-modal-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.pdf-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.pdf-modal-header-banner {
    width: 95%;
    padding: 0 1% 15px 1%;
    text-align: center;
    background: #fff;
    margin: auto;
}

.pdf-modal-header-banner .ad-banner-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.pdf-modal-header-banner .ad-banner-html {
    width: 100%;
    max-width: 100%;
    border: none;
    display: block;
    margin: 0 auto;
    max-height: 150px;
}

.pdf-modal-header-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.pdf-modal-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 0;
    width: 30%;
}

.pdf-modal-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pdf-modal-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pdf-modal-btn svg {
    flex-shrink: 0;
}

.pdf-modal-btn-open {
    color: #0066cc;
    border-color: #0066cc;
}

.pdf-modal-btn-open:hover {
    background: #e6f2ff;
    border-color: #0052a3;
}

.pdf-modal-btn-download {
    color: #28a745;
    border-color: #28a745;
}

.pdf-modal-btn-download:hover {
    background: #e8f5e9;
    border-color: #1e7e34;
}

.pdf-modal-btn-cart {
    color: #ff6b35;
    border-color: #ff6b35;
}

.pdf-modal-btn-cart:hover {
    background: #fff4f0;
    border-color: #e55a2b;
}

.pdf-modal-btn-cart.added {
    background: #e8f5e9;
    border-color: #28a745;
    color: #28a745;
}

.pdf-modal-btn-cart.added:hover {
    background: #d4edda;
    border-color: #1e7e34;
}

.cart-icon-image-small {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.pdf-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.pdf-modal-close:hover {
    background: #e9ecef;
    color: #000;
}

.pdf-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.pdf-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .pdf-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .pdf-modal-header {
        border-radius: 0;
    }
    
    .pdf-modal-header-buttons {
        padding: 10px 15px;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .pdf-modal-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex: 0 0 auto;
        min-width: fit-content;
        justify-content: center;
    }
    
    .pdf-modal-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .cart-icon-image-small {
        width: 16px;
        height: 16px;
    }
}

