﻿/* Main container */
.card-table-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    font-size: 0.7rem;
}

/* Card style */
.card-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    flex: 1 1 50rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.card-row-container {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
}

.card-row {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0;
    width: min(100%, 8rem);
    max-width: min(100%, 8rem);
    flex-grow: 1;
}

.card-label {
    font-weight: bold;
    text-transform: capitalize;
    margin-right: 10px;
}

.card-value {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-controls {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.search-input, .sort-select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    padding-right: 35px;
}

.sort-select {
    flex: 1;
    min-width: 150px;
}



.card-row-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}


.btn-action {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
}

    .btn-action:hover {
        opacity: 0.8;
    }


.btn-edit {
    background-color: #3498db;
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-view {
    background-color: #2ecc71;
    color: white;
}



.btn-export {
    background-color: #27ae60;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    height: 2.5rem;
}

    .btn-export:hover {
        background-color: #219150;
    }


/*-------------------------------*/
/*-------------------------------*/

.table-counter {
    font-size: 0.85rem;
    color: #666;
    background: #eee;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    font-weight: 500;
}


.table-controls {
    align-items: center;
}


.text-right {
    text-align: right;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.card-value {
    flex: 1;
}


.card-checkbox-container {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.card-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.global-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-global {
    background-color: #6c5ce7;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    height: 2.5rem;
}


.btn-select-all {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #495057;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    height: 2.5rem;
}

    .btn-select-all:hover {
        background-color: #e2e6ea;
    }

    .btn-select-all.active {
        background-color: #d1d8ff;
        border-color: #6c5ce7;
        color: #6c5ce7;
    }


.column-selector {
    position: relative;
    display: inline-block;
}

.column-dropdown {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-radius: 5px;
    min-width: 180px;
}


.column-selector:hover .column-dropdown {
    display: block;
}

.column-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 0.85rem;
    cursor: pointer;
}


.labels-hidden .card-label {
    display: none;
}


.btn-toggle-labels {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

    .btn-toggle-labels.active {
        background-color: #34495e;
        color: white;
        border-color: #2c3e50;
    }





.table-responsive-container {
    width: 100%;
    overflow-x: auto;
    max-height: 500px;
    border: 1px solid #ddd;
}

.classic-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background: white;
}


    .classic-table thead th {
        position: sticky;
        top: 0;
        background-color: #f8f9fa;
        z-index: 4;
        padding: 12px;
        border-bottom: 2px solid #dee2e6;
        text-align: left;
    }

    .classic-table td {
        padding: 10px;
        border-bottom: 1px solid #eee;
    }

    .classic-table tr:hover {
        background-color: #f1f1f1;
    }



.sort-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px !important;
}

    .sort-header::after {
        content: '↕';
        position: absolute;
        right: 5px;
        opacity: 0.3;
    }

    .sort-header.asc::after {
        content: '↑';
        opacity: 1;
        color: #6c5ce7;
    }

    .sort-header.desc::after {
        content: '↓';
        opacity: 1;
        color: #6c5ce7;
    }



.search-container {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    line-height: 1;
}

    .search-clear:hover {
        color: #666;
    }



/*-------------------------------*/
/*-------------------------------*/

/* Favorites button */
.btn-fav {
    background: #ff951f;
    border: 1px solid #f0932b;
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
    height: 2.5rem;
}

/*-------------------------------*/
/*-------------------------------*/

/* Modal Styles */
.cyg-table-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4;
    padding: 1rem;
    box-sizing: border-box;
}

.cyg-table-modal-content {
    display: flex;
    flex-direction: column;
    row-gap: 1rem;
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    height: 100%;
    max-width: clamp(300px, 50vw, 40%);
    max-height: clamp(400px, 50vw, 60%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    justify-content: space-between;
}

.fav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: .3rem;
}

    .fav-item:hover {
        background: #f9f9f9;
    }

.btn-save-fav {
    width: 100%;
    padding: 8px;
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.fav-item.active {
    border-left: 4px solid #6c5ce7;
    background: #f0edff;
    font-weight: bold;
}

#fav-list{
    height: 100%;
    overflow: auto;
}


/*-------------------------------*/
/*-------------------------------*/

.btn-global.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


.cyg-data-cards-hidden {
    display: none;
}