/* Airtable Sync Frontend Styles */

/* Container */
.airtable-records-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Search */
.airtable-search-wrapper {
    margin-bottom: 20px;
    position: relative;
}

.airtable-search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.airtable-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

/* Elementor widget: Ajax search filter - search bar */
.airtable-ajax-search-filter__input {
    border: 1px solid #d3d3d3 !important;
    border-radius: 10px !important;
}

.airtable-ajax-search-filter__input:focus {
    outline: none;
    border: 2px solid #2271b1 !important;

}

.airtable-search-loading {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    display: flex;
    align-items: center;
}

.airtable-search-loading .loading-dots {
    display: inline-block;
}

/* Tags Filter */
.airtable-filters-wrapper {
    margin-bottom: 20px;
}

.airtable-tags-filter {
    margin-bottom: 20px;
}

.airtable-filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    font-size: 14px;
}

.airtable-tags-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.airtable-tag-filter-btn {
    padding: 6px 12px;
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.airtable-tag-filter-btn:hover {
    background: #e0e0e0;
    border-color: #651027;
    color: #651027;
}

.airtable-tag-filter-btn[aria-pressed="true"] {
    background: #651027;
    border-color: #651027;
    color: #fff;
}

.airtable-tag-filter-btn[aria-pressed="true"]:hover {
    background: #4a0b1c;
    border-color: #4a0b1c;
}

/* Advanced Filters Accordion */
.airtable-advanced-filters {
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.airtable-accordion-toggle {
    width: 100%;
    padding: 12px 16px;
    background: #f8f8f8;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: background 0.3s;
}

.airtable-accordion-toggle:hover {
    background: #f0f0f0;
}

.airtable-accordion-toggle[aria-expanded="true"] {
    background: #e8f4f8;
}

.accordion-title {
    flex: 1;
}

.accordion-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin: 0 8px;
    background: #e0e0e0;
    color: #666;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s;
}

.accordion-counter.has-filters {
    background: #651027;
    color: #fff;
}

.accordion-icon {
    transition: transform 0.3s;
    font-size: 12px;
    color: #666;
}

.airtable-accordion-toggle[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

.airtable-accordion-content {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.airtable-filter-group {
    margin-bottom: 16px;
}

.airtable-filter-group:last-child {
    margin-bottom: 0;
}

/* Results Count */
.airtable-results-count {
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-count-text {
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.results-count-loading {
    display: inline-flex;
    align-items: center;
}

.results-count-loading .loading-dots {
    display: inline-block;
}

/* Records List - Masonry Layout */
.airtable-records-list {
    column-count: 3;
    column-gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .airtable-records-list {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .airtable-records-list {
        column-count: 1;
    }
}

/* Tool Card - Isometric Parallelepiped */
.airtable-tool-card {
    position: relative;
    background: #ffffff;
    padding: 20px;
    
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s, transform 0.2s;
    display: inline-block;
    width: 100%;
    margin-bottom: 24px;
    break-inside: avoid;
    page-break-inside: avoid;
    box-sizing: border-box;
}

/* LATO DESTRO */
.airtable-tool-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: -6px;
    width: 6px;
    height: 100%;
    background: rgba(0, 0, 0, 0.08);
    transform: skewY(45deg);
    transform-origin: left;
    z-index: -1;
}

/* BASE */
.airtable-tool-card::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.12);
    transform: skewX(45deg);
    transform-origin: top;
    z-index: -1;
}

.airtable-tool-card:hover {

    transform: translateY(-2px);
}

/* Header */
.tool-card-header {
    margin-bottom: 10px;
}

.tool-card-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tool-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.3;
    flex: 1;
}

/* Description */
.tool-card-description {
    color: #555;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 10px;
    flex: 1;
}

/* Tags */
.tool-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tool-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 11px;
    color: #555;
    font-weight: 500;
}

.tool-tag-area {
    background: #e3f2fd;
    color: #1976d2;
}

.tool-price {
    display: inline-block;
    padding: 3px 10px;
    background: #e8f5e9;
    border-radius: 12px;
    font-size: 11px;
    color: #2e7d32;
    font-weight: 600;
}

/* Actions (Link and More button) */
.tool-card-actions {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.tool-link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #651027;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
    margin-left: auto;
}

.tool-link-button:hover {
    background: #4a0b1c;
    color: #fff;
}

.tool-more-button {
    padding: 8px 16px;
    background: #f0f0f0;
    color: #555;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.tool-more-button:hover {
    background: #e0e0e0;
    border-color: #2271b1;
    color: #2271b1;
}

/* Modal */
.airtable-tool-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.airtable-tool-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.airtable-tool-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.airtable-tool-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    max-height: 90vh;
    width: 90%;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}

.airtable-tool-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.airtable-tool-modal-close:hover {
    background: #e0e0e0;
}

.airtable-tool-modal-body {
    padding: 30px;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #1a1a1a;
    padding-right: 40px;
}

.modal-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-icon-link {
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-icon-link:hover {
    transform: scale(1.05);
}

.modal-icon {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field:last-child {
    margin-bottom: 0;
}

.modal-field strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.modal-field p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modal-link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.modal-link-button:hover {
    background: #135e96;
    color: #fff;
}

/* Loading Initial */
.airtable-loading-initial {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

.airtable-loading-initial .loading-text {
    margin-right: 8px;
}

/* Filters Loading */
.airtable-filters-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.airtable-filters-loading .loading-text {
    margin-right: 8px;
}

/* Loading Dots Animation */
.loading-dots {
    display: inline-block;
}

.loading-dots .dot {
    display: inline-block;
    animation: loading-dots 1.4s infinite;
    animation-fill-mode: both;
    font-size: 20px;
    line-height: 1;
}

.loading-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading-dots {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* No Results */
.airtable-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Show More Button */
.airtable-show-more-wrapper {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.airtable-show-more-button {
    padding: 12px 32px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.airtable-show-more-button:hover:not(:disabled) {
    background: #135e96;
}

.airtable-show-more-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Pagination */
.airtable-records-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.airtable-records-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s;
}

.airtable-records-pagination .page-numbers:hover,
.airtable-records-pagination .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Lightbox */
.airtable-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10010;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.airtable-lightbox.active {
    display: flex;
}

.airtable-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.airtable-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.airtable-lightbox-title {
    color: #fff;
    font-size: 18px;
    margin-top: 20px;
    padding: 0 20px;
}

.airtable-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 36px;
    cursor: pointer;
    transition: background 0.3s;
    text-align: center;
}

.airtable-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.airtable-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 46px;
    cursor: pointer;
    transition: background 0.3s;
    text-align: center;
    user-select: none;
}

.airtable-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.airtable-lightbox-prev {
    left: 20px;
}

.airtable-lightbox-next {
    right: 20px;
}

.airtable-lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .airtable-lightbox-nav {
        width: 40px;
        height: 40px;
        line-height: 36px;
        font-size: 20px;
    }

    .airtable-lightbox-prev {
        left: 10px;
    }

    .airtable-lightbox-next {
        right: 10px;
    }

    .airtable-lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        line-height: 31px;
        font-size: 20px;
    }
}