/**
 * Export Page Styles
 *
 * @package Konkani_Hymns
 */

.konkani-hymns-export-page {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
}

.export-page-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.export-main-content {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
}

.konkani-hymns-export-page h2 {
    margin-bottom: 20px;
    color: #1d2327;
}

.export-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-select,
.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.export-status {
    margin-bottom: 15px;
    padding: 10px;
    background: #f0f0f1;
    border-left: 4px solid #2271b1;
}

.export-status p {
    margin: 0;
    font-weight: 600;
}

.hymns-list {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #fff;
    margin-bottom: 20px;
}

.hymn-item {
    padding: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

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

.hymn-item:hover {
    background-color: #f9f9f9;
}

.hymn-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.hymn-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.hymn-info {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hymn-serial {
    font-weight: 600;
    color: #2271b1;
}

.hymn-title {
    font-weight: 500;
    color: #1d2327;
}

.hymn-category {
    color: #646970;
    font-size: 0.9em;
}

.export-actions {
    text-align: center;
    padding: 20px 0;
}

.export-actions .button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

.export-actions .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.export-loading {
    text-align: center;
    padding: 20px;
    background: #f0f0f1;
    border-radius: 4px;
    margin-top: 20px;
}

.export-loading p {
    margin: 0;
    font-weight: 600;
    color: #2271b1;
}

.konkani-hymns-export-message {
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.konkani-hymns-export-message p {
    margin: 0;
    color: #646970;
}

/* Right Sidebar */
.export-sidebar {
    width: 350px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.export-sidebar-content {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.export-sidebar h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
    color: #1d2327;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-sidebar h3 .selected-count {
    font-weight: normal;
    color: #2271b1;
    font-size: 0.9em;
}

.selected-hymns-list {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    margin-bottom: 20px;
    min-height: 200px;
}

.selected-hymns-list .empty-state {
    text-align: center;
    color: #646970;
    padding: 40px 20px;
    margin: 0;
    font-style: italic;
}

.selected-hymn-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
    font-size: 0.9em;
}

.selected-hymn-item .selected-hymn-serial {
    font-weight: 600;
    color: #2271b1;
    display: block;
    margin-bottom: 4px;
}

.selected-hymn-item .selected-hymn-title {
    color: #1d2327;
    display: block;
}

.export-sidebar-actions {
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.export-sidebar-actions .button {
    width: 100%;
    margin: 0;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
}

.export-sidebar-actions .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.export-sidebar-actions .button:hover:not(:disabled) {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

/* Accordion Layout */
.konkani-hymns-export-accordion {
    margin-top: 20px;
}

.export-category-accordion {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.export-category-header {
    width: 100%;
    padding: 15px 20px;
    background: #f0f0f1;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    font-weight: 600;
    color: #1d2327;
    transition: background-color 0.2s;
}

.export-category-header:hover {
    background: #e0e0e0;
}

.export-category-header[aria-expanded="true"] {
    background: #2271b1;
    color: #fff;
}

.export-category-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(45deg);
}

.export-category-header .category-title {
    flex: 1;
}

.export-category-header .hymn-count {
    margin-left: 10px;
    font-size: 0.9em;
    font-weight: normal;
    opacity: 0.8;
}

.export-category-header .accordion-icon {
    font-size: 1.5em;
    font-weight: 300;
    line-height: 1;
    transition: transform 0.3s;
    margin-left: 15px;
}

.export-category-content {
    padding: 0;
    background: #fff;
}

.export-category-content .hymns-list {
    max-height: none;
    overflow-y: visible;
    border: none;
    padding: 15px 20px;
    margin: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .export-page-wrapper {
        flex-direction: column;
    }

    .export-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
    }

    .selected-hymns-list {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .export-controls {
        padding: 10px;
    }

    .search-input {
        width: 100%;
    }

    .hymn-info {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Remove Button */
.selected-hymn-item {
    position: relative;
    padding-right: 30px; /* Make room for the button */
}

.remove-hymn-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    color: #d63638;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    user-select: none;
}

.remove-hymn-btn:hover {
    background-color: #d63638;
    color: #fff;
}
