/* Tora Media Library - Frontend Styles */

* {
    box-sizing: border-box;
}

/* Override Avada theme styles - Force white background everywhere */
:root {
    --awb-color3: #fff !important;
    --awb-color4: #fff !important;
    --awb-color5: #fff !important;
}

body:has(.tora-gallery-wrapper) {
    --awb-color3: #fff !important;
    --awb-color4: #fff !important;
    --awb-color5: #fff !important;
}

body:has(.tora-gallery-wrapper) *:not(.tora-card-type):not(.tora-filter-item):not(.tora-tag-filter-btn):not(.tora-pdf-icon):not(.tora-video-icon) {
    --awb-color3: #fff !important;
}

.tora-gallery-wrapper,
.tora-main-content,
.tora-sidebar,
.tora-fullwidth-page {
    background: #fff !important;
    background-color: #fff !important;
}

/* Filtered out items */
.tora-card.filtered-out {
    display: none !important;
}

/* Tab content visibility */
.tora-tab-content {
    display: none;
}

.tora-tab-content.active {
    display: block;
    background: #fff !important;
}

.tora-gallery-wrapper {
    display: flex;
    min-height: 500px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    border-radius: 12px;
    overflow: visible;
    border: 1px solid #e5e7eb;
}

/* Custom Scrollbar - Modern Orange Style */
.tora-gallery-wrapper ::-webkit-scrollbar,
.tora-sidebar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.tora-gallery-wrapper ::-webkit-scrollbar-track,
.tora-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tora-gallery-wrapper ::-webkit-scrollbar-thumb,
.tora-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f97316, #ea580c);
    border-radius: 10px;
}

.tora-gallery-wrapper ::-webkit-scrollbar-thumb:hover,
.tora-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ea580c, #c2410c);
}

/* Firefox scrollbar */
.tora-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #f97316 #f1f1f1;
}

/* Sidebar */
.tora-sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
    overflow-y: auto;
}

.tora-sidebar-section {
    padding: 20px 0;
}

.tora-sidebar-title {
    padding: 0 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.tora-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tora-group-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #4b5563;
    font-weight: 500;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.tora-group-item:hover {
    background: #f9fafb;
    color: #1f2937;
}

.tora-group-item.active {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.08) 0%, transparent 100%);
    border-left-color: #f97316;
    color: #f97316;
}

.tora-group-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    flex-shrink: 0;
}

.tora-group-item.active svg {
    opacity: 1;
}

.tora-group-count {
    margin-left: auto;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 600;
}

.tora-group-item.active .tora-group-count {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

/* Filter Section */
.tora-filter-section {
    padding: 20px;
    padding-bottom: 80px;
    border-top: 1px solid #e5e7eb;
}

.tora-filter-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.tora-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tora-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    color: #4b5563;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.tora-filter-item:hover {
    color: #1f2937;
}

.tora-filter-item.active {
    color: #f97316;
}

.tora-filter-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tora-filter-item.active .tora-filter-checkbox {
    background: #f97316;
    border-color: #f97316;
}

.tora-filter-checkbox svg {
    width: 12px;
    height: 12px;
    color: #fff;
    opacity: 0;
}

.tora-filter-item.active .tora-filter-checkbox svg {
    opacity: 1;
}

/* Main Content */
.tora-main-content {
    flex: 1;
    padding: 25px 30px;
    overflow: visible;
    background: #fff;
}

/* Top Bar */
.tora-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.tora-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tora-current-group {
    font-size: 1.35rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.tora-item-count {
    font-size: 0.85rem;
    color: #6b7280;
    background: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
}

/* Tags Filter */
.tora-tags-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.tora-tag-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tora-tag-filter-btn:hover {
    border-color: #f97316;
    color: #f97316;
}

.tora-tag-filter-btn.active {
    background: #f97316;
    border-color: #f97316;
    color: #fff;
}

.tora-tag-filter-btn.active .tora-tag-dot {
    border: 2px solid #fff;
}

.tora-tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tora-tag-filter-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tora-tag-filter-btn.active .tora-tag-filter-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Tag filtered out */
.tora-card.tag-filtered-out {
    display: none !important;
}

/* Grid */
.tora-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    background: #fff !important;
    background-color: #fff !important;
}

/* Card */
.tora-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e5e7eb;
}

.tora-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.tora-card-image {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f3f4f6;
}

.tora-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tora-card:hover .tora-card-image img {
    transform: scale(1.05);
}

/* Overlay */
.tora-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tora-card:hover .tora-card-overlay {
    opacity: 1;
}

.tora-overlay-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: translateY(15px);
    opacity: 0;
    text-decoration: none;
}

.tora-card:hover .tora-overlay-btn {
    transform: translateY(0);
    opacity: 1;
}

.tora-card:hover .tora-overlay-btn:nth-child(2) {
    transition-delay: 0.05s;
}

.tora-btn-view {
    background: #fff;
    color: #1a1a2e;
}

.tora-btn-view:hover {
    background: #f97316;
    color: #fff;
    transform: scale(1.1);
}

.tora-btn-download {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.tora-btn-download:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.tora-overlay-btn svg {
    width: 18px;
    height: 18px;
}

/* Card Info */
.tora-card-info {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tora-card-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
}

.tora-card-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tora-card-type.pdf {
    background: #fef2f2;
    color: #dc2626;
}

.tora-card-type.video {
    background: #f0fdf4;
    color: #16a34a;
}

.tora-card-type svg {
    width: 12px;
    height: 12px;
}

/* PDF Card */
.tora-card.pdf .tora-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.tora-pdf-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tora-pdf-icon svg {
    width: 50px;
    height: 50px;
    color: #dc2626;
}

.tora-pdf-icon span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Video Card */
.tora-card.video .tora-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #bbf7d0 100%);
}

.tora-video-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tora-video-icon svg {
    width: 50px;
    height: 50px;
    color: #16a34a;
}

.tora-video-icon span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Pagination */
.tora-pagination {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e5e7eb;
}

.tora-page-numbers {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.tora-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tora-page-btn:hover {
    border-color: #f97316;
    color: #f97316;
    background: #fff7ed;
}

.tora-page-btn.active {
    background: #f97316;
    border-color: #f97316;
    color: #fff;
}

.tora-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tora-page-btn svg {
    width: 16px;
    height: 16px;
}

.tora-page-info {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 10px;
}

/* Lightbox */
.tora-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tora-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.tora-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.tora-lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.tora-lightbox-content iframe {
    width: 90vw;
    height: 85vh;
    max-width: 900px;
    border-radius: 8px;
    background: #fff;
    border: none;
}

.tora-lightbox-content video {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    background: #000;
}

.tora-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10002;
}

.tora-lightbox-close:hover {
    background: #fff;
    color: #1a1a2e;
    transform: rotate(90deg);
}

.tora-lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tora-lightbox-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.tora-lightbox-download {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.tora-lightbox-download:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    color: #fff;
}

.tora-lightbox-download svg {
    width: 14px;
    height: 14px;
}

/* Lightbox Navigation */
.tora-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.tora-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.tora-lightbox-nav.prev {
    left: 20px;
}

.tora-lightbox-nav.next {
    right: 20px;
}

.tora-lightbox-nav svg {
    width: 24px;
    height: 24px;
}

.tora-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 10001;
}

/* Swipe indicator for mobile */
.tora-swipe-hint {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    display: none;
    align-items: center;
    gap: 8px;
    animation: swipeHint 2s ease-in-out infinite;
}

.tora-swipe-hint svg {
    width: 20px;
    height: 20px;
}

@keyframes swipeHint {
    0%, 100% { opacity: 0.5; transform: translateX(-50%); }
    50% { opacity: 1; transform: translateX(-40%); }
}

/* Mobile Menu Toggle */
.tora-mobile-toggle {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #1f2937;
    cursor: pointer;
    z-index: 101;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    align-items: center;
    justify-content: center;
}

.tora-mobile-toggle:hover {
    background: #f9fafb;
}

.tora-mobile-toggle svg {
    width: 22px;
    height: 22px;
}

/* Sidebar overlay for mobile */
.tora-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.tora-sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 900px) {
    .tora-gallery-wrapper {
        position: relative;
    }

    .tora-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        height: -webkit-fill-available;
        min-height: 100vh;
        min-height: 100dvh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tora-sidebar.open {
        transform: translateX(0);
    }

    .tora-main-content {
        padding: 15px 15px 20px 15px;
    }

    .tora-mobile-toggle {
        display: flex;
    }

    .tora-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }

    .tora-lightbox-nav {
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.3);
    }

    .tora-lightbox-nav.prev {
        left: 10px;
    }

    .tora-lightbox-nav.next {
        right: 10px;
    }

    .tora-lightbox-nav svg {
        width: 20px;
        height: 20px;
    }

    .tora-swipe-hint {
        display: flex;
    }

    .tora-lightbox-content {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
    }

    .tora-lightbox-content img {
        max-width: 95%;
        max-height: 70vh;
    }

    .tora-lightbox-content iframe {
        width: 95vw;
        height: 70vh;
        max-width: none;
    }

    .tora-lightbox-content video {
        max-width: 95vw;
        max-height: 65vh;
    }
}

@media (max-width: 600px) {
    .tora-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .tora-current-group {
        font-size: 1.15rem;
    }

    .tora-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .tora-card-image {
        height: 130px;
    }

    .tora-card-info {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .tora-card-title {
        font-size: 0.75rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        max-width: 100%;
        line-height: 1.3;
        word-break: break-word;
    }

    .tora-overlay-btn {
        width: 36px;
        height: 36px;
    }

    .tora-lightbox-info {
        flex-direction: column;
        gap: 10px;
        padding: 12px 20px;
        width: calc(100% - 40px);
        border-radius: 16px;
    }

    .tora-lightbox-content iframe {
        width: calc(100vw - 20px);
        height: 75vh;
        max-width: none;
    }

    .tora-lightbox-content video {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        max-height: 60vh;
    }

    /* Sayfalama - Mobil Uygulama Stili */
    .tora-pagination {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px;
        padding: 15px 10px;
        justify-content: center;
        align-items: center;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .tora-page-numbers {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center;
        justify-content: center;
        gap: 4px;
        order: 2;
        width: 100%;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .tora-page-numbers .tora-page-btn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .tora-page-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.85rem;
        flex-shrink: 0;
        display: inline-flex !important;
        visibility: visible !important;
    }

    .tora-page-btn[data-action="prev"] {
        order: 1;
    }

    .tora-page-btn[data-action="next"] {
        order: 3;
    }

    .tora-page-btn .btn-text {
        display: none;
    }

    .tora-page-info {
        display: none;
    }
}
