/* General Styles */
body {
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: #2c3e50;
    font-family: 'Vazir', 'Tahoma', sans-serif;
    line-height: 1.6;
}

#content {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    #content {
        padding: 10px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px; /* Counteract padding on columns */
}

.col-12, .col-6, .col-3 {
    padding: 10px;
    box-sizing: border-box;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }

@media (max-width: 768px) {
    .col-6, .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Typography */
h1, h2, h3 {
    color: #37517e;
    margin-bottom: 20px;
    text-align: center;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.5em; }

p {
    line-height: 1.8;
    margin-bottom: 15px;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Breadcrumb */
.breadcrumb {
    background-color: #e9ecef;
    padding: 15px 20px;
    margin-bottom: 30px;
    font-size: 0.9em;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px;
}

.breadcrumb a {
    color: #6c757d;
    padding: 0 5px;
}

.breadcrumb span.gold {
    color: #d4af37;
    font-weight: bold;
}

/* Detail Header */
.detail-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.journal-main-title {
    color: #ffffff !important;
    text-transform: capitalize;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Info Cards Grid */
.info-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .info-cards-grid {
        grid-template-columns: 1fr;
    }
}

.info-card {
    background-color: #ffffff;
    border-radius: 8px;
    height: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 20px;
}

.info-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: right;
    border-bottom: 2px solid #37517e;
    padding-bottom: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item span:first-child {
    font-weight: bold;
    color: #555;
}

.info-item a {
    color: #007bff;
    font-weight: bold;
}

/* Form Section */
.form-section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.form-section h2 {
    margin-top: 0;
    color: #37517e;
    margin-bottom: 25px;
}

.input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.input-container > div {
    flex: 1;
    min-width: 200px;
}

.input-container input[type="checkbox"] {
    margin-left: 10px;
}

.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.flex-container > div {
    flex: 1;
    min-width: 200px;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
}

input[type="text"]::placeholder,
textarea::placeholder {
    font-family: inherit;
    opacity: 0.7;
}

input[type="text"]:focus,
textarea:focus {
    border-color: #007bff;
    outline: none;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.btn-submit {
    background-color: #28a745;
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.2s;
    width: auto;
    display: block;
    margin-top: 20px;
}

.btn-submit:hover {
    background-color: #218838;
}

/* Description Card */
.description-card {
    margin-bottom: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 35px;
    line-height: 1.9;
    border: 1px solid #e8ecf1;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #24348a;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #f0f4ff;
    text-align: right;
}

.section-title svg {
    flex-shrink: 0;
}

.description-content {
    color: #34495e;
    font-size: 1.05rem;
    line-height: 2;
    text-align: justify;
}

.description-content p {
    margin-bottom: 20px;
    color: #2c3e50;
}

.description-content h3,
.description-content h4 {
    color: #24348a;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.description-content ul,
.description-content ol {
    margin: 20px 0;
    padding-right: 30px;
}

.description-content li {
    margin-bottom: 12px;
    color: #2c3e50;
}

.description-content a {
    color: #24348a;
    text-decoration: none;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    transition: all 0.3s;
}

.description-content a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

.description-content strong {
    color: #2c3e50;
    font-weight: 700;
}

.no-description {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 40px 20px;
}

.journal-image-wrapper {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f4ff;
}

.journal-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s, box-shadow 0.3s;
}

.journal-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
}

/* Responsive */
@media (max-width: 768px) {
    .description-card {
        padding: 25px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
}

/* Search Links */
.search-links {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 40px;
}

.search-links .info {
    display: inline-block;
    margin: 0 10px 15px;
}

.search-links .info a {
    background-color: #6c757d;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.2s;
    font-weight: normal;
    display: block; /* Make the entire link clickable area */
}

.search-links .info a:hover {
    background-color: #5a6268;
    text-decoration: none;
}

/* Navigation */
.navigation-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 25px;
    background-color: #24348a;
    color: #fff;
    border-radius: 8px;
    transition: background-color 0.2s;
    font-size: 1.1em;
    font-weight: bold;
    margin: 0 auto 40px;
    width: fit-content;
}

.navigation-link:hover {
    background-color: #138496;
    text-decoration: none;
}

.navigation-link svg {
    fill: #fff;
    width: 24px;
    height: 24px;
    margin-right: 10px; /* For RTL */
    transform: rotate(180deg); /* Flip arrow for RTL */
}

/* Utility Classes */
.align-center { text-align: center; }
.rdir { direction: rtl; }
.ldir { direction: ltr; }
.b { font-weight: bold; }
.capitalfl { text-transform: capitalize; }
.padding-3 { padding: 1.5rem; }
.border-radius-4 { border-radius: 0.25rem; }
.bg-white { background-color: #fff; }
.border-1-gray { border: 1px solid #ccc; }
.margin-2 { margin: 1rem; }
.margin-top-2 { margin-top: 1rem; }
.gap-10 { gap: 10px; } /* For flex/grid containers */
.w-100 { width: 100%; }
.line-height-2 { line-height: 2; }
.border-radius-5 { border-radius: 0.3125rem; }
.padding-2 { padding: 1rem; }
.margin-bottom-2 { margin-bottom: 1rem; }

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    height: auto;
    min-height: 28px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-research {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.badge-isi {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.badge-scopus {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.badge-pubmed {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.badge-isc {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

.badge-issn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.badge-language {
    background: linear-gradient(135deg, #fd7e14 0%, #dc6108 100%);
}

/* Form Styles */
.flexbox {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.flexcolumn {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 220px;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s;
}

.flexcolumn:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.flexcolumn label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #495057;
    font-size: 0.95rem;
}

.flexcolumn input,
.flexcolumn select {
    padding: 10px 14px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    transition: all 0.3s;
    font-family: inherit;
}

.flexcolumn input:focus,
.flexcolumn select:focus {
    outline: none;
    border-color: #24348a;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.flexcolumn input::placeholder,
.flexcolumn select::placeholder,
.flexcolumn textarea::placeholder {
    font-family: inherit;
    color: #adb5bd;
    opacity: 0.7;
}

.bg-light {
    background-color: #f8f9fa;
}

.border-1-blue {
    border: 1px solid #007bff;
}

.border-radius-2 {
    border-radius: 8px;
}

.w-90 {
    width: 90%;
}

.db {
    display: block;
}

.ma {
    margin: 0 auto;
}

button[type="submit"] {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-clear {
    display: inline-block;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    text-decoration: none;
    padding: 12px 35px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-clear:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.ldir {
    direction: ltr;
    text-align: left;
}

/* Responsive Design */
/* Desktop Large - 4 columns (default) */
@media (min-width: 1280px) {
    .results-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

/* Desktop Small - 3 columns */
@media (min-width: 1025px) and (max-width: 1279px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px;
    }
}

/* Tablet - 2 columns */
@media (max-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .journal-card {
        height: 300px;
    }
    
    .journal-card-title {
        font-size: 1rem;
    }
}

/* Mobile - 1 column */
@media (max-width: 640px) {
    .results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .journal-card {
        height: auto;
        min-height: 280px;
    }
    
    .journal-card-icon {
        padding: 18px 18px 12px;
    }
    
    .journal-card-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .journal-card-content {
        padding: 18px;
    }
    
    .journal-card-title {
        font-size: 1rem;
        -webkit-line-clamp: 4;
        min-height: auto;
    }
    
    .journal-publisher {
        font-size: 0.8rem;
    }
    
    .journal-card-footer {
        padding: 12px 18px;
    }
    
    .journal-card-badges {
        gap: 6px;
    }
    
    .badge {
        padding: 5px 10px;
        font-size: 0.7rem;
        min-height: 26px;
    }
}

/* General form responsive */
@media (max-width: 768px) {
    .flexbox {
        flex-direction: column;
    }
    
    .flexcolumn {
        width: 100%;
        min-width: auto;
    }
    
    .col-6, .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Beautiful Search Form */
.search-form-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.search-form-container h1 {
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2rem;
}

.search-form-container p {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 20px;
}

.form-inner {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Result Cards */
.result-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.result-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.result-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.result-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-info-label {
    font-weight: bold;
    color: #7f8c8d;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #24348a;
    border: 2px solid #e0e7ff;
    background-color: white;
    transition: all 0.3s;
    font-weight: 500;
}

.pagination a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #24348a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.pagination .current-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #24348a;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Details Page Styles */
.detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.detail-header h1 {
    margin: 0;
    font-size: 2rem;
}

.info-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.info-card h2 {
    color: #24348a;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #ecf0f1;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item span:first-child {
    font-weight: bold;
    color: var(--muted, #3c4452);
}

.info-item span:last-child {
    color: var(--text, #1a1d23);
}

/* Breadcrumb */
.breadcrumb {
    background-color: var(--stone, #ffffff);
    color: var(--text, #1a1d23);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--line, rgba(26, 29, 35, 0.14));
}

.breadcrumb a {
    color: var(--footer-link, #0b4f8a);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Results Grid - Card Design */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.journal-card {
    background: white;
    border-radius: 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    overflow: hidden;
    position: relative;
}

.journal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.25);
    border-color: #24348a;
}

.journal-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #24348a;
    border-bottom: 2px solid #e9ecef;
}

.journal-card-icon svg {
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.2));
}

.journal-card-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.journal-card-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    min-height: 63px;
    text-transform: capitalize;
}

.journal-card-title.ldir {
    direction: ltr;
    text-align: left;
}

.journal-card-title.rdir {
    direction: rtl;
    text-align: right;
}

.journal-card-title:hover {
    color: #24348a;
}

.journal-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.journal-publisher {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

.journal-publisher svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.journal-publisher span {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.journal-card-footer {
    padding: 15px 20px;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0.5) 0%, #f8f9fa 100%);
    border-top: 1px solid #e9ecef;
}

.journal-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    min-height: 36px;
}

/* Result Container */
.result-container {
    margin-top: 30px;
}