/* Import Google Fonts - Sansation */
/* @import url('https://fonts.googleapis.com/css2?family=Sansation:wght@300;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Google+Sans+Code:ital,wght@0,300..800;1,300..800&family=Quattrocento+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Google+Sans+Code:ital,wght@0,300..800;1,300..800&family=Quattrocento+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Recursive:wght@300..1000&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Gidole&family=Google+Sans+Code:ital,wght@0,200..800;1,300..800&family=Quattrocento+Sans:ital,wght@0,200;0,700;1,400;1,700&family=Recursive:wght@200..1000&display=swap'); */

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Gidole&family=Google+Sans+Code:ital,wght@0,300..800;1,300..800&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Quattrocento+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Recursive:wght@300..1000&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --metal-dark: #2c3e50;
    --metal-mid: #7f8c8d;
    --metal-light: #bdc3c7;
    --steel-blue: #34495e;
    --chrome: #ecf0f1;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Verdana, sans-serif;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.container {
    max-width: 95%;
    margin: 0px auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: var(--metal-dark);
    /* text-transform: uppercase; */
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--metal-light);
}

.title-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.home-link {
    text-decoration: none;
    transition: all 0.3s ease;
}

.home-link h1 {
    cursor: pointer;
    transition: all 0.3s ease;
}

.home-link:hover h1 {
    color: var(--steel-blue);
    transform: translateY(-2px);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 16px;
    border: 1px solid var(--metal-light);
    border-radius: 10px;
    /* background: linear-gradient(145deg, #f8f9fa, #e9ecef); */
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.1), -2px -2px 6px rgba(255, 255, 255, 0.8);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--steel-blue);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-weight: bold;
    color: var(--metal-dark);
}

.user-email {
    font-size: 0.75em;
    color: #999;
    margin-top: 2px;
}

.logout-btn {
    padding: 8px 16px;
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid var(--metal-mid);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-btn:hover {
    background: linear-gradient(145deg, #7f8c8d, #6c7a7b);
    transform: translateY(-1px);
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.card {
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border-radius: 10px;
    box-shadow: 5px 5px 15px #d1d1d1, -5px -5px 15px #ffffff;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.upload-section {
    text-align: center;
    margin-bottom: 0;
}

.upload-stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.upload-stats-container .card {
    margin-bottom: 0;
    height: 300px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.stats-section {
    text-align: center;
    margin-bottom: 0;
}

.sources-section {
    text-align: center;
    margin-bottom: 0;
}

.stat-item {
    padding: 20px;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--steel-blue);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: var(--metal-mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.type-breakdown {
    margin-top: 0;
    padding-top: 0;
    text-align: left;
}

.type-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    margin: 3px 0;
    background: rgba(52, 73, 94, 0.05);
    border-radius: 4px;
}

.type-badge {
    background-color: var(--steel-blue);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65em;
    text-transform: uppercase;
    font-weight: bold;
}

.type-count {
    font-weight: bold;
    color: var(--steel-blue);
    font-size: 0.95em;
}

.btn {
    background: linear-gradient(to bottom, var(--metal-light) 0%, var(--metal-mid) 100%);
    border: 1px solid var(--metal-dark);
    color: var(--metal-dark);
    padding: 10px 25px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px var(--shadow);
}

.btn:hover {
    background: linear-gradient(to bottom, var(--metal-mid) 0%, var(--metal-light) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--shadow);
}

.btn-danger {
    background: linear-gradient(to bottom, #e74c3c 0%, #c0392b 100%);
    border: 1px solid #a93226;
    color: white;
    padding: 10px 25px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(to bottom, #c0392b 0%, #e74c3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}


.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 5px 5px 15px #d1d1d1, -5px -5px 15px #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.type-filter {
    padding: 8px 12px;
    border: 1px solid var(--metal-light);
    border-radius: 5px;
    background: white;
    color: var(--metal-dark);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.type-filter:hover {
    border-color: var(--steel-blue);
}

.type-filter:focus {
    outline: none;
    border-color: var(--steel-blue);
    box-shadow: 0 0 5px rgba(52, 73, 94, 0.3);
}

.lang-switcher {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.lang-switcher a {
    text-decoration: none;
    margin-left: 5px;
    font-size: 0.95em;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s;
    white-space: nowrap;
}

.lang-switcher a:hover,
.lang-switcher a.active {
    background: var(--steel-blue);
    color: white;
}

/* DataTables Customization */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-title {
    margin: 0;
    color: var(--metal-dark);
    font-size: 1.2em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-title i {
    color: var(--steel-blue);
}

.table-divider {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 15px 0 20px 0;
}

/* Mobile cards container - hidden by default (desktop) */
.mobile-cards-container {
    display: none;
}

/* Export Buttons */
.dt-buttons {
    margin-bottom: 15px;
}

.btn-export {
    background: linear-gradient(to bottom, var(--steel-blue), var(--metal-dark)) !important;
    color: white !important;
    border: none !important;
    padding: 8px 15px !important;
    margin-right: 5px !important;
    border-radius: 5px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
}

.btn-export:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

table.dataTable {
    border-collapse: collapse !important;
}

table.dataTable thead th {
    background: linear-gradient(to bottom, var(--steel-blue), var(--metal-dark));
    color: white !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    padding: 12px 8px !important;
    border-bottom: 2px solid var(--metal-dark) !important;
}

table.dataTable tbody td {
    padding: 10px 8px !important;
    vertical-align: top;
    font-size: 0.9em;
}

table.dataTable tbody tr:hover {
    background-color: #e9ecef !important;
}

/* Cell Styles */
.title-cell {
    color: var(--metal-dark);
    line-height: 1.6;
}

.title-cell strong {
    font-size: 1em;
    display: block;
    margin-bottom: 5px;
}

.author-cell {
    font-size: 0.9em;
    color: #555;
    line-height: 1.4;
}

.links-cell {
    text-align: center;
}

.link-icon {
    font-size: 1.3em;
    text-decoration: none;
    margin: 0 3px;
    display: inline-block;
    transition: transform 0.2s;
}

.link-icon:hover {
    transform: scale(1.3);
}

.entry-type {
    background-color: var(--steel-blue);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    text-transform: uppercase;
    display: inline-block;
}

.info-btn {
    border: none;
    background: none;
    /* background: var(--steel-blue);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); */
}

.info-btn:hover {
    /* background: var(--metal-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); */
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-body {
    margin-top: 20px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section strong {
    color: var(--metal-dark);
    display: block;
    margin-bottom: 5px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: black;
}

.original-string {
    background-color: #2d2d2d;
    color: #ccc;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    font-size: 0.85em;
    border: 1px solid #444;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    max-height: 300px;
    overflow-y: auto;
}

.alert {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 600;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: 1px solid #27ae60;
    color: white;
}

.alert-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: 1px solid #c0392b;
    color: white;
}


.swal2-confirm {
    background: linear-gradient(145deg, var(--steel-blue), var(--metal-dark)) !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
    padding: 12px 25px !important;
    box-shadow: 0 3px 10px rgba(52, 73, 94, 0.3) !important;
    transition: all 0.3s ease !important;
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Verdana, sans-serif !important;
}

.swal2-confirm:hover {
    background: linear-gradient(145deg, var(--metal-dark), var(--steel-blue)) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(52, 73, 94, 0.4) !important;
}

.swal2-cancel {
    background: linear-gradient(145deg, var(--metal-mid), var(--metal-light)) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
    padding: 12px 25px !important;
    box-shadow: 0 3px 10px rgba(127, 140, 141, 0.3) !important;
    transition: all 0.3s ease !important;
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Verdana, sans-serif !important;
}

.swal2-deny {
    text-transform: none !important;
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Verdana, sans-serif !important;
}

.swal2-cancel:hover {
    background: linear-gradient(145deg, var(--metal-light), var(--metal-mid)) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(127, 140, 141, 0.4) !important;
}

.swal2-timer-progress-bar {
    background: var(--steel-blue) !important;
    height: 4px !important;
}

.swal2-backdrop {
    background: rgba(44, 62, 80, 0.6) !important;
    backdrop-filter: blur(3px) !important;
}

/* Animações especiais para SweetAlert */
.swal2-show {
    animation: swal2-show-custom 0.3s !important;
}

.swal2-hide {
    animation: swal2-hide-custom 0.3s !important;
}

@keyframes swal2-show-custom {
    0% {
        transform: scale(0.7) translateY(-20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes swal2-hide-custom {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }

    100% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
}

/* DataTables Search Box */
.dataTables_filter input {
    border: 1px solid var(--metal-light);
    border-radius: 5px;
    padding: 5px 10px;
    margin-left: 10px;
}

.dataTables_length select {
    border: 1px solid var(--metal-light);
    border-radius: 5px;
    padding: 5px;
}

/* Favorite Star Icon */
.star-icon {
    font-size: 1.2em;
    cursor: pointer;
    color: #ccc;
    /* Inactive color (gray) */
    transition: color 0.2s, transform 0.2s;
    margin-right: 5px;
    display: inline-block;
}

.star-icon.active {
    color: #f1c40f;
    /* Active color (yellow/gold) */
}

.star-icon:hover {
    transform: scale(1.2);
}

/* Favorites Filter */
.favorites-filter-container {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.favorites-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    color: var(--metal-dark);
}

.favorites-toggle input {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 25px;
    background-color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--steel-blue), var(--metal-mid));
    border-radius: 12px;
    transition: width 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Upload Area Styling */
.upload-area {
    border: 2px dashed var(--metal-mid);
    border-radius: 12px;
    padding: 10px 15px;
    margin: 15px 0;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(145deg, #fafafa, #f0f0f0);
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--steel-blue);
    background: linear-gradient(145deg, #f0f0f0, #e8e8e8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-icon {
    max-width: 70px;
    height: auto;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon {
    opacity: 1;
    transform: scale(1.05);
}

.upload-text {
    font-size: 0.9em;
    color: var(--metal-mid);
    font-weight: 500;
    margin: 0;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-text {
    color: var(--steel-blue);
}

.file-name-display {
    display: none;
    margin: 10px 0;
    padding: 10px 15px;
    background: linear-gradient(145deg, #e8f5e9, #c8e6c9);
    border-left: 4px solid #4caf50;
    border-radius: 6px;
    color: #2e7d32;
    font-weight: 600;
    text-align: center;
}

/* ========================================
   RESPONSIVIDADE MOBILE
   ======================================== */

/* Tablets e dispositivos médios */
@media screen and (max-width: 1024px) {
    .container {
        max-width: 98%;
        margin: 20px auto;
        padding: 15px;
    }

    .upload-stats-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .upload-stats-container .card {
        height: auto;
        min-height: 200px;
    }

    /* Controls - melhor espaçamento em tablets */
    .controls-section {
        gap: 12px;
    }

    .filter-group {
        min-width: 200px;
    }

    .lang-switcher {
        min-width: fit-content;
    }

    .favorites-filter-container {
        min-width: fit-content;
    }
}

/* Smartphones e dispositivos pequenos */
@media screen and (max-width: 768px) {
    .container {
        max-width: 100%;
        margin: 10px auto;
        padding: 10px;
    }

    /* Header responsivo */
    .header-section {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .title-area {
        flex-direction: column;
        gap: 10px;
    }

    .title-area h1 {
        font-size: 1.5em;
        letter-spacing: 1px;
    }

    .user-profile {
        flex-direction: row;
        gap: 8px;
        text-align: center;
    }

    .user-info {
        align-items: center;
    }

    /* Botões responsivos */
    .home-btn,
    .logout-btn {
        padding: 8px 12px;
        font-size: 1em;
    }

    .btn,
    .btn-danger {
        padding: 8px 15px;
        font-size: 0.9em;
        margin: 5px 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* Cards responsivos */
    .card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .upload-stats-container {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }

    /* Controles responsivos */
    .controls-section {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        align-items: stretch;
    }

    /* Upload area responsivo */
    .upload-area {
        padding: 15px 10px;
    }

    .upload-icon {
        max-width: 80px;
    }

    .upload-text {
        font-size: 0.85em;
    }

    .filter-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .filter-group label {
        text-align: left;
    }

    .type-filter {
        width: 100%;
        padding: 10px;
    }

    .lang-switcher {
        width: 100%;
        justify-content: flex-start;
    }

    .lang-switcher span {
        width: 100%;
        margin-bottom: 5px;
    }

    .favorites-filter-container {
        width: 100%;
        margin-left: 0;
    }

    .favorites-toggle {
        justify-content: flex-start;
    }

    /* Tabela responsiva - Mobile Card Layout */
    .table-container {
        padding: 10px;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .table-title {
        font-size: 1.2em;
        text-align: center;
    }

    .table-header .btn-danger {
        width: 100%;
    }

    /* Esconder tabela tradicional em mobile */
    #bibTable_wrapper .dataTables_scrollX,
    #bibTable {
        display: none;
    }

    /* Layout de cards para mobile */
    .mobile-cards-container {
        display: block;
    }

    /* Hide table on mobile, show cards */
    .table-container table {
        display: none;
    }

    .mobile-entry-card {
        background: linear-gradient(145deg, #ffffff, #e6e6e6);
        border-radius: 10px;
        box-shadow: 3px 3px 10px #d1d1d1, -3px -3px 10px #ffffff;
        padding: 15px;
        margin-bottom: 15px;
        border: 1px solid rgba(255, 255, 255, 0.5);
        position: relative;
    }

    .mobile-entry-card:hover {
        box-shadow: 5px 5px 15px #c0c0c0, -5px -5px 15px #ffffff;
    }

    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 10px;
        gap: 10px;
    }

    .mobile-card-title {
        flex: 1;
        min-width: 0;
    }

    .mobile-card-title h4 {
        margin: 0 0 5px 0;
        color: var(--metal-dark);
        font-size: 1.1em;
        line-height: 1.3;
        word-wrap: break-word;
    }

    .mobile-card-type {
        background-color: var(--steel-blue);
        color: white;
        padding: 3px 8px;
        border-radius: 15px;
        font-size: 0.7em;
        text-transform: uppercase;
        font-weight: bold;
        white-space: nowrap;
    }

    .mobile-card-actions {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .mobile-star-icon {
        font-size: 1.2em;
        cursor: pointer;
        color: #ccc;
        transition: all 0.3s;
    }

    .mobile-star-icon.active {
        color: #ffd700;
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.6);
    }

    .mobile-info-btn {
        background: linear-gradient(135deg, var(--steel-blue) 0%, #2c3e50 100%);
        color: white !important;
        border: none;
        padding: 8px 12px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 0.85em;
        font-weight: 600;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        text-decoration: none;
    }

    .mobile-info-btn:hover {
        background: linear-gradient(135deg, #3b4f63 0%, #34495e 100%);
        color: white !important;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .mobile-card-details {
        margin: 12px 0;
        font-size: 0.9em;
    }

    .mobile-detail-row {
        display: flex;
        margin-bottom: 8px;
        align-items: flex-start;
    }

    .mobile-label {
        font-weight: bold;
        color: var(--metal-dark);
        min-width: 70px;
        margin-right: 8px;
        flex-shrink: 0;
        font-size: 0.9em;
    }

    .mobile-detail-row span:not(.mobile-label) {
        color: #555;
        line-height: 1.4;
        word-wrap: break-word;
    }

    .cite-key {
        font-family: 'Courier New', monospace;
        background: #f8f9fa;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.85em;
    }

    .mobile-card-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .mobile-action-btn {
        /* background: linear-gradient(135deg, var(--chrome) 0%, #ddd 100%); */
        border: 1px solid var(--metal-light);
        color: var(--metal-dark);
        padding: 8px 12px;
        border-radius: 8px;
        text-decoration: none;
        font-size: 0.85em;
        font-weight: 600;
        transition: all 0.3s ease;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .mobile-action-btn:hover {
        background: linear-gradient(135deg, #fff 0%, var(--chrome) 100%);
        border-color: var(--steel-blue);
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* DataTables controls mobile */
    .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        margin-bottom: 15px;
        justify-content: center;
    }

    .btn-export {
        padding: 8px 12px !important;
        font-size: 0.8em !important;
        margin: 2px !important;
        flex: 1 1 auto;
        min-width: 100px;
        max-width: 150px;
    }

    /* Modal responsivo */
    .modal-content {
        margin: 2% auto;
        width: 95%;
        max-width: 95%;
        padding: 20px;
        max-height: 90vh;
    }

    .modal-content h2 {
        font-size: 1.3em;
    }

    .detail-section {
        margin-bottom: 15px;
    }

    .detail-section strong {
        font-size: 0.9em;
    }

    .original-string {
        font-size: 0.75em;
        max-height: 200px;
    }

    /* DataTables mobile */
    .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        margin-bottom: 10px;
    }

    .btn-export {
        padding: 6px 10px !important;
        font-size: 0.8em !important;
        margin: 2px !important;
        flex: 1 1 auto;
        min-width: 80px;
    }

    .dataTables_length,
    .dataTables_filter {
        margin-bottom: 10px;
    }

    .dataTables_length select,
    .dataTables_filter input {
        width: 100%;
        padding: 8px;
        margin-top: 5px;
    }

    /* Estatísticas mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .type-breakdown {
        text-align: center;
    }

    .type-stat {
        padding: 8px;
        margin: 5px 0;
        font-size: 0.9em;
    }

    /* Language switcher mobile */
    .lang-switcher {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
    }

    .lang-switcher a {
        padding: 8px 12px;
        font-size: 0.9em;
        margin: 2px;
    }

    /* Progress bar mobile */
    .progress-bar-container {
        margin: 15px 0;
    }

    #progressText {
        font-size: 0.9em;
    }

    /* SweetAlert mobile */
    .swal2-popup {
        width: 90% !important;
        margin: 0 5% !important;
        font-size: 0.9em !important;
    }

    .swal2-title {
        font-size: 1.2em !important;
    }

    .swal2-content {
        font-size: 1em !important;
    }

    .swal2-confirm,
    .swal2-cancel {
        padding: 10px 20px !important;
        font-size: 0.9em !important;
    }
}

/* Smartphones muito pequenos */
@media screen and (max-width: 480px) {
    .container {
        padding: 5px;
    }

    .card {
        padding: 15px;
    }

    .title-area h1 {
        font-size: 1.2em;
    }

    .home-btn,
    .logout-btn {
        padding: 6px 8px;
        font-size: 0.9em;
    }

    #bibTable {
        font-size: 0.8em;
    }

    #bibTable th,
    #bibTable td {
        padding: 6px 2px !important;
        min-width: 100px;
    }

    .modal-content {
        padding: 15px;
        margin: 1% auto;
        width: 98%;
    }

    .btn-export {
        font-size: 0.7em !important;
        padding: 5px 8px !important;
    }

    .swal2-popup {
        width: 95% !important;
        margin: 0 2.5% !important;
    }
}

/* Desktop and larger screens - show table, hide mobile cards */
@media (min-width: 769px) {
    .table-container table {
        display: table !important;
    }

    .mobile-cards-container {
        display: none !important;
    }
}

/* ========================================
   PWA INSTALL POPUP
   ======================================== */

.pwa-install-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 340px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    padding: 20px;
    z-index: 9999;
    animation: slideInRight 0.5s ease-out;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(44, 62, 80, 0.1);
}

.pwa-install-popup.hidden {
    display: none;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.pwa-install-popup.hiding {
    animation: slideOutRight 0.4s ease-in forwards;
}

.pwa-popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.pwa-popup-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    /* background: linear-gradient(145deg, var(--steel-blue), var(--metal-dark)); */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.3);
}

.pwa-popup-title {
    flex: 1;
}

.pwa-popup-title h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--metal-dark);
    font-weight: bold;
}

.pwa-popup-title p {
    margin: 3px 0 0 0;
    font-size: 0.75em;
    color: var(--metal-mid);
}

.pwa-popup-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: var(--metal-mid);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.pwa-popup-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--metal-dark);
    transform: rotate(90deg);
}

.pwa-popup-body {
    margin-bottom: 15px;
}

.pwa-popup-body p {
    margin: 0;
    color: #555;
    font-size: 0.9em;
    line-height: 1.5;
}

.pwa-popup-features {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.pwa-popup-features li {
    padding: 6px 0;
    color: #666;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-popup-features li:before {
    content: "✓";
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1em;
}

.pwa-popup-actions {
    display: flex;
    gap: 10px;
}

.pwa-popup-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pwa-install-btn {
    background: linear-gradient(145deg, var(--steel-blue), var(--metal-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.3);
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 73, 94, 0.4);
}

.pwa-later-btn {
    background: linear-gradient(145deg, #e0e0e0, #c0c0c0);
    color: var(--metal-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pwa-later-btn:hover {
    background: linear-gradient(145deg, #d0d0d0, #b0b0b0);
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .pwa-install-popup {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .pwa-popup-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .pwa-popup-title h3 {
        font-size: 1em;
    }

    .pwa-popup-actions {
        flex-direction: column;
    }

    .pwa-popup-btn {
        width: 100%;
    }
}

/* ========================================
   PWA FLOATING INSTALL BUTTON
   ======================================== */

.pwa-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, var(--steel-blue), var(--metal-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(52, 73, 94, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
    border: none;
    animation: pulse 2s infinite;
}

.pwa-floating-btn.hidden {
    display: none;
}

.pwa-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(52, 73, 94, 0.5);
}

.pwa-floating-btn i {
    font-size: 28px;
    color: white;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(52, 73, 94, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(52, 73, 94, 0.6);
    }
}

/* Tooltip for floating button */
.pwa-floating-btn::before {
    content: "Instalar App";
    position: absolute;
    right: 70px;
    background: var(--metal-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.pwa-floating-btn:hover::before {
    opacity: 1;
}

/* Mobile adjustments for floating button */
@media screen and (max-width: 768px) {
    .pwa-floating-btn {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
    }

    .pwa-floating-btn i {
        font-size: 24px;
    }

    .pwa-floating-btn::before {
        display: none;
        /* Hide tooltip on mobile */
    }
}

/* SweetAlert Font Override */
div:where(.swal2-container) .swal2-popup {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Verdana, sans-serif !important;
}