@font-face {
    font-family: 'BMitra';
    src: url('../../asset/fonts/BMitra.ttf') format('truetype');
    font-style: normal;
    font-weight: normal;
}

@font-face {
    font-family: 'BYekan';
    src: url('../../asset/fonts/BYekan.ttf') format('truetype');
    font-style: normal;
    font-weight: normal;
}

:root {
    --primary-color: #2c6e9c;
    --secondary-color: #5093c7;
    --accent-color: #ffc107;
    --text-color: #333;
    --light-bg: #f5f8fa;
    --border-radius: 12px;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    --album-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

html, body {
  overflow-x: hidden;
}

.grid-container,
.album-grid {
  padding-left: 10px;
  padding-right: 10px;
}

@media (max-width: 450px) {
  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .back-button {
    right: 10px;
  }
}

/* General Styles */
body {
    font-family: 'BYekan', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: center;
    background: var(--light-bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    color: var(--text-color);
}

/* Header with Logo */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px 20px 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-title {
    color: white;
    margin: 0 0 15px;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
}

/* Search Box */
.search-container {
    width: 100%;
    max-width: 600px;
    margin: -25px auto 20px;
    padding: 0 15px;
    position: relative;
    z-index: 10;
    direction:rtl;
}

#search-box {
    font-family: 'BYekan', Tahoma;
    width: 100%;
    padding: 16px 25px;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    text-align: right;
    transition: var(--transition);
    box-sizing: border-box;
    outline: none;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

#search-box:focus {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

#search-box::placeholder {
    color: #aaa;
    opacity: 0.8;
}

/* Back Button */
.back-button {
    position: fixed;
    top: 120px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-family: 'BYekan', Tahoma;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    display: none;
}

.back-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    padding: 10px 30px 50px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Album Grid - Different layout for albums */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 30px 50px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Album Card */
.album-card {
    background: white;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.album-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--album-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.album-card:hover::before {
    opacity: 0.05;
}

.album-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--secondary-color);
}

.album-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

.album-card:hover .album-icon {
    transform: scale(1.1) rotate(5deg);
}

.album-info {
    text-align: center;
    position: relative;
    z-index: 2;
}

.album-title {
    font-family: 'BYekan', Tahoma;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.4;
}

.album-count {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
    padding: 5px 15px;
    background: rgba(44, 110, 156, 0.1);
    border-radius: 20px;
    display: inline-block;
}

/* USER PANEL */
.panel-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-top: 8px;
}

.panel-link {
    display: block;
    width: 100%;
    padding: 6px 8px;
    text-decoration: none;
    color: inherit;
    font-size: 0.9em;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    background: none;
}

.panel-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    text-decoration: none;
}
/* Item Card */
.item-card {
    background: white;
    padding: 20px 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
    max-height: 400px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.item-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.item-card:hover::after {
    opacity: 1;
}

.item-card img {
    width: 95%;
    max-width: 180px;
    height: 120px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 15px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.item-card:hover img {
    transform: scale(1.05);
}

/* Item Info */
.item-info {
    margin-top: 12px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    height: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

.item-title {
    font-family: 'BYekan', Tahoma, Arial, sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 5px;
    line-height: 1.4;
    word-break: break-word;
}

.item-description {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 3px;
    line-height: 1.5;
    word-break: break-word;
}

.item-place {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    line-height: 1.3;
}

.item-status {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

/* Icon Styles */
.icon-inline {
    font-size: 1rem;
    vertical-align: middle;
    padding: 5px 8px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    box-sizing: content-box;
    color: white;
    margin: 0 2px;
}

/* Overlay Styles */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0;
    backdrop-filter: blur(5px);
}

.overlay-close {
    position: absolute;
    top: 24px;
    right: 28px;
    font-size: 32px;
    color: white;
    cursor: pointer;
    z-index: 1010;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.overlay-close:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    transform: rotate(90deg);
}

.overlay-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    outline: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

#overlay-prev { 
    left: 30px; 
}

#overlay-next { 
    right: 30px; 
}

.overlay-nav:hover, .overlay-nav:focus {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.overlay-nav:hover svg, .overlay-nav:focus svg {
    color: #000;
}

.overlay-nav svg {
    width: 28px;
    height: 28px;
    transition: all 0.3s ease;
}

#overlay-img {
    max-width: 85%;
    max-height: 85%;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Empty State */
.no-results {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: #666;
    font-size: 1.2rem;
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--secondary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
        padding: 10px 20px 40px;
    }
    
    .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 25px;
        padding: 15px 20px 40px;
    }

    .header h1 {
        font-size: 1.6rem;
    }
    
    .back-button {
        top: 110px;
        right: 20px;
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 20px 15px 25px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .search-container {
        margin-top: -20px;
        padding: 0 10px;
    }

    #search-box {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 10px 10px 30px;
    }
    
    .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
        padding: 10px 10px 30px;
    }
    
    .album-card {
        padding: 25px 15px;
        min-height: 160px;
    }
    
    .album-icon {
        font-size: 3rem;
        margin-bottom: 12px;
    }
    
    .album-title {
        font-size: 1.15rem;
    }
    
    .album-count {
        font-size: 0.9rem;
    }

    .item-card {
        padding: 12px 10px;
        min-height: 220px;
    }

    .item-card img {
        height: 100px;
        margin-bottom: 10px;
    }

    .item-title {
        font-size: 1rem;
    }

    .item-description,
    .item-place {
        font-size: 0.85rem;
    }

    .overlay-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .overlay-nav {
        width: 42px;
        height: 42px;
    }

    .overlay-nav svg {
        width: 22px;
        height: 22px;
    }

    #overlay-prev {
        left: 15px;
    }

    #overlay-next {
        right: 15px;
    }
    
    .back-button {
        top: 100px;
        right: 15px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 450px) {
    .album-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .album-card {
        padding: 20px 15px;
        min-height: 140px;
    }
    
    .album-icon {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }
    
    .album-title {
        font-size: 1rem;
    }

    #overlay-prev, #overlay-next {
        top: auto;
        bottom: 30px;
        transform: none;
    }

    #overlay-prev {
        left: calc(50% - 50px);
        right: auto;
    }

    #overlay-next {
        right: calc(50% - 50px);
        left: auto;
    }

    .overlay-nav:hover, .overlay-nav:focus {
        transform: scale(1.1);
    }
}