/* --- font-face: IRANSans --- */
@font-face {
    font-family: 'IRANSans';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/IRANSans/IRANSansWeb.eot');
    src: url('fonts/IRANSans/IRANSansWeb.eot?#iefix') format('embedded-opentype'),
         url('fonts/IRANSans/IRANSansWeb.woff2') format('woff2'),
         url('fonts/IRANSans/IRANSansWeb.woff') format('woff'),
         url('fonts/IRANSans/IRANSansWeb.ttf') format('truetype');
}

@font-face {
    font-family: 'IRANSans';
    font-style: normal;
    font-weight: bold;
    src: url('fonts/IRANSans/IRANSansWeb_Bold.eot');
    src: url('fonts/IRANSans/IRANSansWeb_Bold.eot?#iefix') format('embedded-opentype'),
         url('fonts/IRANSans/IRANSansWeb_Bold.woff2') format('woff2'),
         url('fonts/IRANSans/IRANSansWeb_Bold.woff') format('woff'),
         url('fonts/IRANSans/IRANSansWeb_Bold.ttf') format('truetype');
}
*{
    font-family: 'Vazirmatn', sans-serif;
}
/* --- General Styles --- */
body {
    direction: rtl;
    font-family: 'IRANSans', sans-serif;
    background-color: #f4f7f6;
    color: #2c3e50;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    text-align: center;
    color: #34495e;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
}

.upload-form, .login-form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    padding: 12px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-family: 'IRANSans', sans-serif;
    font-size: 16px;
}

.submit-btn {
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    text-align: center;
}

.submit-btn:hover {
    background-color: #2980b9;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: bold;
    text-align: center;
}

.message.success {
    background-color: #e8f9ed;
    color: #2ecc71;
}

.message.error {
    background-color: #fdeaea;
    color: #e74c3c;
}

/* ADMIN PANEL & PROFESSIONAL UPLOADER STYLES */
.top-nav {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin-bottom: 20px;
}
.admin-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: #f0f4f7;
    border-radius: 6px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}
.admin-link:hover {
    background-color: #e8eaed;
}

.dashboard {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background-color: #f0f4f7;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    flex: 1;
    min-width: 200px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-5px);
}
.stat-card h3 {
    margin: 0;
    font-size: 32px;
    color: #34495e;
}
.stat-card p {
    margin: 5px 0 0;
    font-size: 16px;
    color: #7f8c8d;
}

.filter-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: flex-end;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
}
.filter-options .form-group {
    flex: 1;
    min-width: 150px;
}

.bulk-actions {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.image-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}
.image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}
.image-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}
.image-info p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.image-card .delete-btn {
    margin-top: auto;
    padding: 10px;
    border-radius: 0 0 12px 12px;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}
.delete-btn:hover {
    background-color: #c0392b;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}
.modal-content {
    margin: 5% auto;
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 800px;
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.modal-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 20px;
    border-radius: 8px;
}
.modal-close {
    color: #34495e;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}
.modal-close:hover {
    color: #e74c3c;
}
.modal-info {
    line-height: 1.8;
}
.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}
.pagination-btn {
    padding: 10px 15px;
    background-color: #f0f4f7;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.pagination-btn:hover {
    background-color: #e8eaed;
}
.pagination-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}
.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* --- بهبود قسمت انتخاب فایل (Advanced Uploader) --- */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: all 0.3s ease;
    min-height: 150px;
}
.file-input-wrapper:hover, .file-input-wrapper.drag-over {
    border-color: #3498db;
    background-color: #ecf0f1;
}
.file-input-wrapper.file-selected {
    border-color: #2ecc71;
    background-color: #e8f9ed;
}
.file-input-wrapper .file-icon {
    font-size: 48px;
    color: #7f8c8d;
}
.file-input-wrapper.file-selected .file-icon, .file-input-wrapper:hover .file-icon {
    color: #3498db;
}
.file-input-wrapper .file-label {
    color: #7f8c8d;
    font-size: 16px;
}
.file-input-wrapper.file-selected .file-label {
    color: #2c3e50;
}
#imageFiles {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
#previewContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}
.preview-card {
    position: relative;
    width: 150px;
    height: 150px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f9f9f9;
}
.preview-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.preview-card .remove-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.preview-card .filename {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    background-color: rgba(0,0,0,0.6);
    color: white;
    font-size: 12px;
    padding: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-progress {
    width: 100%;
    height: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 15px;
}
.upload-progress-bar {
    height: 100%;
    background-color: #3498db;
    width: 0;
    transition: width 0.3s ease;
}
.submit-btn {
}
.message {
    margin-top: 15px;
}
#uploadedLinksContainer {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.uploaded-link-item {
    background-color: #ecf0f1;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.uploaded-link-item .preview-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    margin-left: 10px;
}
.uploaded-link-item a {
    word-break: break-all;
    flex-grow: 1;
}
.uploaded-link-item .submit-btn {
    display: inline-block;
    width: auto;
    margin-right: 10px;
}