/**
 * GravityView - Kanban View Styles
 */

/* Kanban Board */
.go-kanban-board {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 20px 0;
    margin: 0 -10px;
    min-height: 500px;
    align-items: flex-start;
}

/* Kanban Column */
.go-kanban-column {
    flex: 0 0 300px;
    margin: 0 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    min-height: 300px;
    overflow: hidden;
}

/* Kanban Column Header */
.go-kanban-column-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 15px;
    background-color: #e0e0e0;
    border-radius: 5px 5px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.go-kanban-column-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: black;
}

.go-kanban-column-count {
    background-color: #fff;
    color: black;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Kanban Column Body */
.go-kanban-column-body {
    padding: 10px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 100px;
    max-height: 60vh;
}

/* Kanban Card */
.go-kanban-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    transition: box-shadow 0.2s ease;
}

.go-kanban-card:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Kanban Card Header */
.go-kanban-card-header {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.go-kanban-card-title {
    color: black;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

/* Kanban Card Body */
.go-kanban-card-body {
    padding: 10px 15px;
}

.go-kanban-card-field {
    margin-bottom: 8px;
    font-size: 13px;
}

.go-kanban-card-field-label {
    font-weight: 600;
    margin-right: 5px;
}

/* ---------------------------------------------
    Lightbox (Fancybox) adjustments for Kanban
    --------------------------------------------- */
/*
Reduce white space around the Kanban Single Entry when opened in a lightbox.
These styles only load on pages using the Kanban template, keeping scope limited.
*/

/* Make the Fancybox content frame adapt to card size with a reasonable max */
/* Fancybox v4 (double-underscore) */
.fancybox__container .fancybox__content {
    width: auto !important;
    /* Prefer a viewport-aware cap where supported */
    max-width: min(90vw, 720px) !important;
    padding: 12px 16px !important; /* reduce default inner padding */
}

/* Fancybox v3 (single dash classes) */
.fancybox-container .fancybox-content {
    width: auto !important;
    max-width: min(90vw, 720px) !important;
    padding: 12px 16px !important;
}

/* Reduce extra chrome around iframe slides in Fancybox v3 */
.fancybox-slide--iframe .fancybox-content {
    padding: 8px 12px !important;
}

/* On wider screens, make the lightbox content about half the viewport width */
@media (min-width: 992px) {
    .fancybox__container .fancybox__content {
        width: 50vw !important;
        max-width: 900px !important;
    }

    /* Fancybox v3 wide screens */
    .fancybox-container .fancybox-content {
        width: 50vw !important;
        max-width: 900px !important;
    }
}

/* Tighten the reviews area width inside Single Entry (applies within iframe content) */
.gv-reviews-area {
    width: 85% !important;
    margin: 0 auto !important;
}

/* Keep the Kanban Single Entry card compact inside the iframe */
.go-kanban-card.single-entry {
    width: auto;
    max-width: 720px;
    margin: 0 auto;
}

.go-kanban-card-field-value {
    color: #555;
}

/* Kanban Card Footer */
.go-kanban-card-footer {
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

.go-kanban-card-link {
    font-size: 12px;
    text-decoration: none;
    color: #0073aa;
}

.go-kanban-card-link:hover {
    text-decoration: underline;
}

/* Empty Column Message */
.go-kanban-empty-column {
    padding: 20px;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* Uncategorized Entries Section */
.go-kanban-uncategorized {
    margin-top: 30px;
    background-color: #f5f5f5;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.go-kanban-uncategorized-header {
    padding: 10px 15px;
    background-color: #e0e0e0;
    border-radius: 5px 5px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.go-kanban-uncategorized-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.go-kanban-uncategorized-body {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.go-kanban-uncategorized-body .go-kanban-card {
    flex: 0 0 calc(25% - 15px);
    max-width: calc(25% - 15px);
}

@media (max-width: 1200px) {
    .go-kanban-uncategorized-body .go-kanban-card {
        flex: 0 0 calc(33.333% - 15px);
        max-width: calc(33.333% - 15px);
    }
}

@media (max-width: 768px) {
    .go-kanban-uncategorized-body .go-kanban-card {
        flex: 0 0 calc(50% - 15px);
        max-width: calc(50% - 15px);
    }
}

@media (max-width: 480px) {
    .go-kanban-uncategorized-body .go-kanban-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Error Messages */
.go-kanban-error {
    padding: 15px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .go-kanban-board {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .go-kanban-column {
        flex: 0 0 100%;
        margin-bottom: 20px;
    }
}

/* Loading Indicator */
.go-kanban-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    /*display: flex;*/
    align-items: center;
    justify-content: center;
    z-index: 1001;
    display: none;
}

.go-kanban-loading.active {
    display: flex;
}

.go-kanban-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Notifications */
.go-kanban-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: #fff;
    font-weight: 500;
    z-index: 1002;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.go-kanban-notification.success {
    background-color: #4caf50;
}

.go-kanban-notification.error {
    background-color: #f44336;
}

.go-kanban-notification.active {
    opacity: 1;
    transform: translateY(0);
}

.go-kanban-card.single-entry {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.go-kanban-card.single-entry .go-kanban-card-title {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 15px;
}

.go-kanban-card.single-entry .go-kanban-card-field {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.go-kanban-card.single-entry .go-kanban-card-body {
    padding: 20px;
}
