/* ===========================================
   Archive Banner Styles - Enhanced Version
   =========================================== */

/* ---- Common Banner Styles ---- */
.archive-banner {
    padding: 116px 0 50px 0;
    position: relative;
    min-height: 400px;
    background: linear-gradient(180deg, rgba(89, 198, 209, 0.1) 0%, rgba(89, 198, 209, 0.05) 100%);
}

/* Border gradient at bottom */
.banner-border-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(270deg,
            rgba(89, 198, 209, 0) 7.24%,
            #59c6d1 50%,
            rgba(89, 198, 209, 0) 92.76%);
}

.banner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 300px;
    position: relative;
    z-index: 2;
}

.banner-content {
    flex: 0 0 60%;
}

.content-wrapper-b {
    padding: 20px;
    margin-bottom: 20px;
}

.banner-title {
    line-height: 1.5;
    font-weight: 800;
    margin-top: 15px;
    /* margin-bottom: 15px; */
    color: #59c6d1;
}

.banner-subtitle {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 0.5rem;
    display: block;
    /* رنگ پیش‌فرض جدید */
    color: #0c4a6d;
}

.banner-description {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.8;
    margin-bottom: 6px;
    color: #556070;
    text-align: justify;
}

.banner-sidebar {
    flex: 0 0 40%;
}

.sidebar-image {
    text-align: center;
    display: flex;
    justify-content: end;
}

.sidebar-image img {
    max-width: 100%;
    max-height: 325px;
    height: auto;
    border-radius: 8px;
}

/* ---- Style 1 Specific ---- */
.banner-style-1 {
    padding: 100 0 50px 0;
}

/* ---- Style 2 Specific ---- */
.banner-style-2 {
    padding: 140px 30px 0;
}

.banner-style-2 .banner-container {
    gap: 0px;
}

.banner-style-2 .content-wrapper-b {
    padding: 0 20px;
}

.banner-style-2 .banner-title-wrapper {
    text-align: center;
    width: 100%;
}

.banner-style-2 .banner-content {
    flex: 0 0 60%;
}

.banner-style-2 .banner-sidebar {
    flex: 0 0 40%;
}

.banner-properties {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
    text-align: start;
}

.banner-properties li {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.6;
    padding-right: 25px;
    margin-bottom: 6px;
    position: relative;
    /* رنگ پیش‌فرض جدید */
    color: #556070;
}

.banner-properties li::before {
    content: "";
    position: absolute;
    right: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.8;
    /* رنگ پیش‌فرض جدید */
    background: #556070;
}

/* ---- Style 3 Specific ---- */
.banner-style-3-wrapper {
    padding: 116px 0 30px 0px;
    margin-bottom: 30px;
    position: relative;
    /* پس‌زمینه پیش‌فرض */
    background: linear-gradient(90deg,
            rgba(89, 198, 209, 0) 7.24%,
            rgba(89, 198, 209, 0.15) 50%,
            rgba(89, 198, 209, 0) 92.76%);
}

.banner-style-3-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.banner-style-3-header {
    text-align: center;
    margin-bottom: 20px;
}

.category-grid {
    display: grid;
    gap: 15px;
    margin: 30px 0;
}

.category-grid-1 {
    grid-template-columns: 1fr;
}

.category-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.category-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.category-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #b0bfc6;
    display: flex;
    gap: 1rem;
    align-items: center;
    min-height: 120px;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.category-image {
    flex: 0 0 150px;
    height: 150px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #b0bfc6;
    background-color: #e6eaed;
    padding: 1rem;
    width: 100%;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-content {
    flex: 1;
    padding: 1.5rem 0 1.5rem 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
}

.category-card-title {
    font-weight: 800;
    color: #222;
    line-height: 1.3;
}

.category-link-text {
    color: #5ac5d1;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ---- New Button Styles ---- */
.banner-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

.banner-buttons-start {
    justify-content: flex-start;
}

.banner-buttons-center {
    justify-content: center;
}

.banner-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    border-radius: 20px 0px;
    padding: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
}

.btn-border-wrapper {
    border-radius: 20px 0px;
    padding: 2px;
    width: 100%;
    /* Background will be set dynamically */
    background: linear-gradient(272.67deg,
            rgba(89, 198, 209, 0) 0%,
            #59c6d1 50%,
            rgba(89, 198, 209, 0) 100%);
}

.btn-content-wrapper {
    border-radius: 20px 0px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    /* Background will be set dynamically */
    background: #e3f2f4;
}

.btn-text {
    font-weight: 600;
    font-size: 14px;
    /* Color will be set dynamically */
    color: #59c6d1;
}

/* NEW - Simplified SVG without wrapper */
.btn-content-wrapper svg {
    width: 18px !important;
    height: 18px !important;
    fill: currentColor;
    flex-shrink: 0;
    margin-left: 8px;
}

.banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.banner-btn:focus {
    outline: 2px solid #59c6d1;
    outline-offset: 2px;
}

/* ---- Modal Styles ---- */
.banner-modal-overlay {
    backdrop-filter: blur(2px);
}

.banner-modal-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: min(90vw, 600px);
    max-height: min(90vh, 500px);
}

.banner-modal-close:hover {
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

/* ---- Default Archive Header ---- */
.default-archive-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
    position: relative;
}

.default-archive-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(270deg,
            rgba(89, 198, 209, 0) 7.24%,
            #59c6d1 50%,
            rgba(89, 198, 209, 0) 92.76%);
}

.default-archive-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.default-archive-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #59c6d1;
    font-weight: 700;
}

.default-archive-header p {
    font-size: 1.2em;
    color: #556070;
    margin: 0;
    line-height: 1.6;
}

/* ---- Admin Styles ---- */
.banner-images-wrapper {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
}

.banner-images-wrapper p {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.banner-images-wrapper button {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 5px;
}

.property-item {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.property-item input {
    flex: 1;
}

.button-item {
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: #f9f9f9;
}

.button-item h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #59c6d1;
    padding-bottom: 10px;
}

/* Additional Admin Form Styles */
.form-table th {
    width: 200px;
}

.color-picker-container {
    display: inline-block;
}

/* Style field visibility controls */
.style-1-field,
.style-2-field,
.style-3-field {
    transition: all 0.3s ease;
}

/* Title decorations for style 2 and 3 */
.banner-style-2 .banner-title,
.banner-style-3 .banner-title {
    padding: 0 15px;
    position: relative;
    display: inline-block;
}

.banner-style-2 .banner-title-wrapper,
.banner-style-3 .banner-style-3-header {
    text-align: center;
}

/* Loading state */
.banner-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.banner-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #59c6d1;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: banner-spin 1s linear infinite;
}

@keyframes banner-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Error states */
.banner-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #dc2626;
}

.banner-error h3 {
    margin-top: 0;
    color: #dc2626;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

/* ---- Tablet (768px - 1023px) ---- */
@media (max-width: 1023px) and (min-width: 768px) {
    .archive-banner {
        padding: 80 0 40px 0;
    }

    .banner-container {
        padding: 0 15px;
    }

    .banner-subtitle {
        font-size: 28px;
    }

    .banner-description {
        font-size: 14px;
    }

    .content-wrapper-b {
        padding: 15px;
    }

    .banner-properties li {
        font-size: 14px;
        padding-right: 15px;
    }

    .banner-sidebar {
        flex: 0 0 300px;
    }

    .category-grid {
        gap: 12px;
    }

    .category-card {
        min-height: 100px;
    }

    .category-image {
        flex: 0 0 120px;
        height: 120px;
    }
}

/* ---- Mobile (767px and below) ---- */
@media (max-width: 767px) {

    /* Common Mobile Styles */
    .archive-banner {
        padding: 60 0 30px 0;
    }

    .banner-border-gradient {
        height: 3px;
    }

    .banner-container {
        flex-direction: column !important;
        padding: 0 15px;
        min-height: 250px;
    }

    .banner-content,
    .banner-sidebar {
        flex: 1 1 100% !important;
        order: unset !important;
    }

    .content-wrapper-b {
        padding: 10px;
        text-align: center;
        margin-bottom: 5px;
    }

    .banner-title {
        margin-top: 2rem;
        text-align: center;
    }

    .banner-subtitle {
        font-size: 22px;
        margin-bottom: 20px;
        text-align: center;
    }

    .banner-description {
        font-size: 16px;
        text-align: center;
    }

    .sidebar-image {
        margin-bottom: 20px;
    }

    /* Button Mobile Styles */
    .banner-buttons {
        justify-content: center !important;
        margin-top: 20px;
        gap: 10px;
    }

    .banner-btn {
        font-size: 13px;
    }

    .btn-content-wrapper {
        padding: 6px 15px;
        gap: 8px;
    }

    .btn-icon {
        width: 28px;
        height: 28px;
    }

    .btn-icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    .btn-text {
        font-size: 13px;
    }

    /* Style 2 Mobile */
    .banner-properties {
        text-align: center;
    }

    .banner-properties li {
        padding-right: 20px !important;
        font-size: 14px !important;
    }

    /* Style 3 Mobile */
    .banner-style-3-wrapper {
        padding: 70px 0 20px 0;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .category-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 15px !important;
        min-height: auto;
    }

    .category-image {
        flex: 0 0 80px !important;
        height: 80px !important;
        align-self: center;
        border-left: none;
        border-bottom: 1px solid #b0bfc6;
        width: 80px;
        margin: 0 auto;
    }

    .category-content {
        flex: 1 !important;
        padding: 15px 0 0 0 !important;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .category-card-title {
        font-size: 16px !important;
        margin-bottom: 8px;
    }

    .category-link-text {
        font-size: 12px;
    }

    /* Modal Mobile */
    .banner-modal-content {
        margin: 10px;
        padding: 15px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .banner-modal-close {
        font-size: 20px !important;
        width: 25px !important;
        height: 25px !important;
        top: 5px !important;
        right: 10px !important;
    }
}

/* ---- Small Mobile (480px and below) ---- */
@media (max-width: 480px) {
    .archive-banner {
        padding: 70px 0 20px 0;
    }

    .banner-container {
        padding: 0 10px;
    }

    .banner-title {
        font-size: 24px !important;
        margin-top: 1rem;
    }

    .banner-subtitle {
        font-size: 18px !important;
    }

    .banner-description {
        font-size: 14px !important;
    }

    .banner-buttons {
        gap: 8px;
    }

    .banner-btn {
        font-size: 12px;
    }

    .btn-content-wrapper {
        gap: 6px;
    }

    .category-grid {
        grid-template-columns: 1fr !important;
    }

    .category-card {
        flex-direction: row !important;
        text-align: right !important;
        padding: 10px !important;
    }

    .category-image {
        flex: 0 0 60px !important;
        height: 60px !important;
        width: 60px;
        border-left: 1px solid #b0bfc6;
        border-bottom: none;
        margin: 0;
    }

    .category-content {
        padding: 0 0 0 10px !important;
        text-align: right;
        align-items: flex-start;
    }

    .default-archive-header h1 {
        font-size: 1.8em;
    }

    .default-archive-header p {
        font-size: 1em;
    }
}

/* ---- Very Small Screens (360px and below) ---- */
@media (max-width: 360px) {
    .banner-container {
        padding: 0 5px;
    }

    .content-wrapper-b {
        padding: 5px;
    }

    .banner-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .banner-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }

    .category-card {
        padding: 8px !important;
    }

    .category-image {
        flex: 0 0 50px !important;
        height: 50px !important;
        width: 50px;
    }
}

/* ===========================================
   ACCESSIBILITY & ENHANCEMENT
   =========================================== */

/* Focus states for accessibility */
.category-card:focus {
    outline: 2px solid #59c6d1;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(89, 198, 209, 0.2);
}

.banner-modal-close:focus {
    outline: 2px solid #59c6d1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .banner-title {
        color: #000 !important;
    }

    .banner-subtitle,
    .banner-description {
        color: #333 !important;
    }

    .banner-btn {
        border: 2px solid #000 !important;
    }

    .btn-content-wrapper {
        background: #fff !important;
        color: #000 !important;
    }

    .category-card {
        border: 2px solid #b0bfc6 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .banner-btn,
    .category-card,
    .banner-modal-overlay,
    .banner-modal-content {
        transition: none !important;
        animation: none !important;
    }

    .banner-btn:hover {
        transform: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .default-archive-header {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        color: #fff;
    }

    .default-archive-header h1 {
        color: #59c6d1;
    }

    .default-archive-header p {
        color: #ccc;
    }

    .category-card {
        background: rgba(255, 255, 255, 0.95);
        border-color: #b0bfc6;
        color: #444;
    }

    .category-image {
        background: rgba(255, 255, 255, 0.95);
        border-color: #b0bfc6;
    }

    .banner-modal-content {
        background: #2a2a2a;
        color: #fff;
    }

    .banner-modal-close {
        color: #ccc;
    }

    .banner-modal-close:hover {
        background-color: #444 !important;
        color: #fff !important;
    }
}

/* Print styles */
@media print {

    .archive-banner,
    .banner-style-3-wrapper {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    .banner-border-gradient {
        display: none;
    }

    .banner-btn,
    .category-card {
        display: none;
    }

    .banner-title,
    .banner-subtitle,
    .banner-description {
        color: black !important;
    }

    .banner-container {
        flex-direction: column;
    }

    .sidebar-image img {
        max-width: 200px;
        max-height: 200px;
    }
}

/* ===========================================
   ANIMATION UTILITIES
   =========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.banner-animate-in {
    animation: fadeInUp 0.6s ease-out;
}

.banner-animate-slide {
    animation: slideInRight 0.6s ease-out;
}

.banner-pulse {
    animation: pulse 2s infinite;
}

/* ===========================================
   PERFORMANCE OPTIMIZATIONS
   =========================================== */

/* GPU acceleration for smooth animations */
.banner-btn,
.category-card {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize font rendering */
.banner-title,
.banner-subtitle,
.category-card-title {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Lazy loading support */
.banner-lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.banner-lazy-load.loaded {
    opacity: 1;
}

/* ===========================================
   UTILITY CLASSES
   =========================================== */

.banner-hidden {
    display: none !important;
}

.banner-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.banner-text-center {
    text-align: center !important;
}

.banner-text-right {
    text-align: right !important;
}

.banner-text-left {
    text-align: left !important;
}

.banner-no-wrap {
    white-space: nowrap !important;
}

.banner-ellipsis {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* RTL Support */
[dir="rtl"] .banner-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .category-content {
    text-align: right;
}

[dir="rtl"] .category-link-text {
    flex-direction: row-reverse;
}

/* Container queries support (future-proofing) */
@container (max-width: 500px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* Enhanced error handling styles */
.banner-error-boundary {
    padding: 40px 20px;
    text-align: center;
    border: 2px dashed #dc2626;
    border-radius: 8px;
    background: #fef2f2;
    margin: 20px 0;
}

.banner-error-boundary h3 {
    color: #dc2626;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.banner-error-boundary p {
    color: #7f1d1d;
    margin-bottom: 20px;
}

.banner-error-boundary button {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.banner-error-boundary button:hover {
    background: #b91c1c;
}

/* Admin preview styles */
.banner-admin-preview {
    border: 3px dashed #59c6d1;
    position: relative;
}

.banner-admin-preview::before {
    content: "پیش‌نمایش بنر";
    position: absolute;
    top: -15px;
    right: 20px;
    background: #59c6d1;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* Skeleton loading styles */
.banner-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: banner-skeleton-loading 1.5s infinite;
}

@keyframes banner-skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.banner-skeleton-title {
    height: 60px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.banner-skeleton-subtitle {
    height: 32px;
    border-radius: 6px;
    margin-bottom: 10px;
    width: 70%;
}

.banner-skeleton-description {
    height: 20px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.banner-skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 20px;
    margin-top: 20px;
}

/* --------------------------- */
/* Breadcrumb Styles */
.banner-breadcrumb {
    width: 100%;
    text-align: center;
    /* padding: 15px 20px; */
    position: relative;
    z-index: 10;
}

.banner-breadcrumb ol {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.banner-breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--breadcrumb-color, #556070);
}

.banner-breadcrumb a {
    color: var(--breadcrumb-color, #556070);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.banner-breadcrumb a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.banner-breadcrumb .breadcrumb-separator {
    color: var(--breadcrumb-color, #556070);
    opacity: 0.6;
    font-size: 12px;
}

.banner-breadcrumb li:last-child span:not(.breadcrumb-separator) {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 767px) {
    .banner-breadcrumb {
        /* padding: 12px 15px; */
    }

    .banner-breadcrumb li {
        font-size: 10px;
        gap: 4px;
    }

    .banner-breadcrumb ol {
        gap: 4px;
    }
}