/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Sora:wght@600;700&display=swap');

/* Container principal */
.thiasos-rss-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', sans-serif;
}

/* Top Bar & Controls */
.thiasos-rss-top-bar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.thiasos-rss-controls-right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
}

.thiasos-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    margin-right: 10px;
    letter-spacing: 0.5px;
}

/* View Switcher */
.thiasos-view-switcher {
    display: flex;
    align-items: center;
}

.thiasos-view-toggles {
    display: flex;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
}

.thiasos-view-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #6c757d;
    font-size: 16px;
    transition: all 0.2s;
}

.thiasos-view-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.thiasos-view-btn.active {
    background: #79183D;
    color: #ffffff;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
}

/* Date Filter */
.thiasos-date-filter-wrapper {
    display: flex;
    align-items: center;
}

.thiasos-date-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.thiasos-date-filter {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #495057;
}

.thiasos-reset-filter {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #dc3545;
    font-size: 16px;
    padding: 0 5px;
}

/* Category Menu */
.thiasos-category-menu {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.thiasos-category-menu::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.thiasos-cat-btn {
    white-space: nowrap;
    padding: 8px 20px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 50px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.thiasos-cat-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.thiasos-cat-btn.active {
    background: #79183D;
    color: #fff;
    border-color: #79183D;
    box-shadow: 0 2px 5px rgba(121, 24, 61, 0.3);
}

/* Colonnes */
.thiasos-rss-columns {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

/* Grid View (Default) - styles assumed from PHP logic inline styles mostly, but reinforced here */

/* List View */
.thiasos-rss-columns.thiasos-view-list {
    flex-direction: column;
}

.thiasos-rss-columns.thiasos-view-list .thiasos-rss-column {
    max-width: 100% !important;
    min-width: 100% !important;
    flex: 0 0 100% !important;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.thiasos-rss-columns.thiasos-view-list .thiasos-rss-header {
    width: 250px;
    flex-shrink: 0;
    border-bottom: none;
    border-right: 4px solid #79183D;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px;
}

.thiasos-rss-columns.thiasos-view-list .thiasos-rss-items {
    flex-grow: 1;
    max-height: 300px;
    /* Scrollable in list view? Or just full height? Let's make it auto for now */
    overflow-y: auto;
    padding: 15px;
}

/* Column Base Styling */
.thiasos-rss-column {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.thiasos-rss-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* En-tête de colonne */
.thiasos-rss-header {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 4px solid #79183D;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.thiasos-rss-logo {
    margin-bottom: 10px;
}

.thiasos-rss-logo img {
    max-width: 120px;
    max-height: 50px;
    object-fit: contain;
}

.thiasos-rss-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    font-family: 'Sora', sans-serif;
    line-height: 1.3;
}

.thiasos-rss-description {
    margin: 5px 0 0;
    font-size: 12px;
    color: #888;
    font-family: 'Inter', sans-serif;
}

/* Items RSS */
.thiasos-rss-items {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    max-height: 600px;
}

.thiasos-rss-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.thiasos-rss-item:last-child {
    border-bottom: none;
}

.thiasos-rss-date {
    color: #666;
    font-size: 12px;
    font-weight: 600;
    min-width: 50px;
    flex-shrink: 0;
}

.thiasos-rss-item a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.thiasos-rss-item a:hover {
    color: #79183D;
    text-decoration: underline;
}

.thiasos-rss-error {
    color: #d63638;
    font-size: 13px;
    padding: 15px;
    text-align: center;
}

/* Item caché (filtre date) */
.thiasos-rss-item.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .thiasos-rss-column {
        min-width: 48% !important;
        max-width: 48% !important;
    }
}

@media (max-width: 768px) {
    .thiasos-rss-column {
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .thiasos-rss-columns {
        flex-direction: column;
    }

    /* Mobile Controls */
    .thiasos-rss-controls-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .thiasos-view-switcher,
    .thiasos-date-filter-wrapper {
        width: 100%;
        display: grid;
        grid-template-columns: 100px 1fr;
        align-items: center;
        gap: 10px;
    }

    .thiasos-view-toggles {
        display: flex;
        justify-content: flex-start;
    }

    .thiasos-view-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    .thiasos-label {
        margin-right: 0;
        text-align: left;
    }

    .thiasos-date-input-group {
        width: 100%;
    }

    .thiasos-date-filter {
        flex-grow: 1;
        width: 100%;
    }
}

/* Scrollbar personnalisée */
.thiasos-rss-items::-webkit-scrollbar {
    width: 8px;
}

.thiasos-rss-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.thiasos-rss-items::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.thiasos-rss-items::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* --- Dashboard Customization Styles --- */

/* Customize Button */
.thiasos-customize-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.thiasos-customize-btn:hover {
    background-color: #f8f9fa;
    color: #212529;
    border-color: #adb5bd;
}

/* Share Link Area */
.thiasos-share-link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.thiasos-link-display {
    display: flex;
    flex: 1;
    gap: 5px;
}

.thiasos-link-display input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    background: #f8f9fa;
    color: #495057;
}

.thiasos-copy-btn {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    color: #495057;
}

.thiasos-copy-btn:hover {
    background: #e9ecef;
}

/* Custom Split Layout */
.thiasos-custom-layout {
    display: flex;
    gap: 20px;
    width: 100%;
}

.thiasos-custom-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 768px) {
    .thiasos-custom-layout {
        flex-direction: column;
    }
}

/* Modal Styles */
.thiasos-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    font-family: 'Inter', sans-serif;
}

.thiasos-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.thiasos-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thiasos-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.thiasos-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.thiasos-close:hover,
.thiasos-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.thiasos-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.thiasos-modal-columns {
    display: flex;
    gap: 20px;
    height: 400px;
    /* Fixed height for scrollable areas */
}

.thiasos-modal-col-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    /* Prevent flex overflow */
}

.thiasos-modal-col-wrapper h3 {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    margin: 0;
}

.thiasos-modal-col {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 10px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.thiasos-modal-item {
    background: #fff;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    user-select: none;
}

.thiasos-modal-item:hover {
    border-color: #adb5bd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.thiasos-modal-item.selected {
    background-color: #fdf2f5;
    border-color: #79183D;
    color: #79183D;
}

.thiasos-modal-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.thiasos-modal-controls.center-controls {
    justify-content: space-between;
}

.thiasos-move-btn {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #495057;
    transition: all 0.2s;
}

.thiasos-move-btn:hover {
    background: #e9ecef;
    color: #79183D;
    border-color: #79183D;
}

.thiasos-modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thiasos-btn-text {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
}

.thiasos-btn-text:hover {
    color: #333;
}

.thiasos-modal-actions {
    display: flex;
    gap: 10px;
}

.thiasos-btn-secondary {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    color: #495057;
    transition: all 0.2s;
}

.thiasos-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #333;
}

.thiasos-btn-primary {
    padding: 8px 16px;
    background: #79183D;
    border: 1px solid #79183D;
    border-radius: 4px;
    cursor: pointer;
    color: #ffffff;
    font-weight: 500;
    transition: all 0.2s;
}

.thiasos-btn-primary:hover {
    background: #601330;
    border-color: #601330;
}

@media (max-width: 768px) {
    .thiasos-modal-columns {
        flex-direction: column;
        height: auto;
    }

    .thiasos-modal-col {
        height: 200px;
    }
}