/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Container principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-title h1 {
    font-size: 2em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title h1 i, {
    font-size: 1.8em;
    color: #4dabf7;
}

a {
    text-decoration: none;
}

.header-time-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-time-info span {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

/* Filtros no Header */
.header-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 140px;
}

.filter-group label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
}

.filter-select {
    padding: 10px 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    font-size: 0.95em;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
}

.filter-select:focus {
    outline: none;
    border-color: #4dabf7;
    background: white;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.2);
}

.refresh-btn, .clear-btn {
    padding: 10px 20px;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    height: 42px;
    backdrop-filter: blur(10px);
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.2);
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.clear-btn {
    background: rgba(231, 76, 60, 0.3);
    border-color: rgba(231, 76, 60, 0.5);
}

.clear-btn:hover {
    background: rgba(231, 76, 60, 0.5);
    border-color: rgba(231, 76, 60, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.refresh-btn:active, .clear-btn:active {
    transform: translateY(0);
}

/* Seção dos cards */
.cards-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    min-height: 400px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Barra de progresso no topo do card */
.card-progress-bar {
    height: 6px;
    background: #ecf0f1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.card-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.card-body {
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.card-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.card-socio {
    text-align: left;
    flex: 1;
}

.card-sistema {
    text-align: center;
    flex: 1;
    font-size: 0.7em;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-id {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.6em;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.card-content {
    text-align: center;
}

.code-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 2.2em;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 4px;
    position: relative;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-display.erro {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-color: #f5c6cb;
    font-size: 1.5em;
}

.copy-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.hash-preview {
    font-size: 0.8em;
    color: #95a5a6;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* Mensagem de nenhum resultado */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.no-results i {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results p {
    font-size: 1.1em;
    margin-top: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 25px 20px;
    color: #7f8c8d;
    margin-top: 40px;
}

.footer-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.footer-copyright {
    font-size: 0.9em;
    color: #95a5a6;
}

/* Responsividade */
@media (max-width: 1024px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-time-info {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 20px;
    }

    .header-title h1 {
        font-size: 1.6em;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-time-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .header-filters {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .filter-group {
        min-width: auto;
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .cards-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card-body {
        padding: 15px;
    }

    .code-display {
        font-size: 1.8em;
        letter-spacing: 2px;
    }

    .card-title {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-socio, .card-sistema, .card-id {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .header-title h1 {
        font-size: 1.4em;
        gap: 8px;
    }

    .header-title h1 i {
        font-size: 1.5em;
    }

    .code-display {
        font-size: 1.5em;
        padding: 15px;
    }

    .card-title {
        font-size: 1.1em;
    }
}

/* Animações de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }


/* ==================== TEMA ESCURO ==================== */

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

body.dark-mode .header {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

body.dark-mode .filter-select {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .filter-select:focus {
    background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .cards-section {
    background: #1a1a2e;
}

body.dark-mode .card {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .card:hover {
    border-color: #4dabf7;
}

body.dark-mode .card-header {
    border-bottom-color: #0f3460;
}

body.dark-mode .card-title {
    color: #e0e0e0;
}

body.dark-mode .card-sistema {
    color: #95a5a6;
}

body.dark-mode .code-display {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-color: #0f3460;
    color: #4dabf7;
}

body.dark-mode .hash-preview {
    color: #7f8c8d;
}

body.dark-mode .footer-title {
    color: #e0e0e0;
}

body.dark-mode .footer-copyright {
    color: #7f8c8d;
}

body.dark-mode .loading {
    color: #95a5a6;
}

body.dark-mode .no-results {
    color: #95a5a6;
}

/* Botão de alternância de tema */
.theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.theme-toggle:active {
    transform: translateY(0);
}

body.dark-mode .theme-toggle i::before {
    content: "\f185"; /* fa-sun */
}

/* Ajustes para dashboard em modo escuro */
body.dark-mode .dashboard-header {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

body.dark-mode .stat-card {
    background: #16213e;
    border-left-color: #4dabf7;
}

body.dark-mode .stat-card .value {
    color: #4dabf7;
}

body.dark-mode .filters-section {
    background: #16213e;
}

body.dark-mode .filter-group label {
    color: #e0e0e0;
}

body.dark-mode .chart-card {
    background: #16213e;
}

body.dark-mode .chart-card h3 {
    color: #e0e0e0;
}

body.dark-mode .table-section {
    background: #16213e;
}

body.dark-mode .table-section h3 {
    color: #e0e0e0;
}

body.dark-mode .data-table thead {
    background: #0f3460;
}

body.dark-mode .data-table th {
    color: #e0e0e0;
    border-bottom-color: #0f3460;
}

body.dark-mode .data-table td {
    color: #e0e0e0;
    border-bottom-color: #0f3460;
}

body.dark-mode .data-table tbody tr:hover {
    background: #0f3460;
}

/* Ajustes para página de credenciais em modo escuro */
body.dark-mode .credentials-header {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

body.dark-mode .tabs-container {
    background: #16213e;
}

body.dark-mode .tabs-header {
    background: #0f3460;
    border-bottom-color: #0f3460;
}

body.dark-mode .tab-btn {
    color: #95a5a6;
}

body.dark-mode .tab-btn:hover {
    background: rgba(77, 171, 247, 0.1);
    color: #4dabf7;
}

body.dark-mode .tab-btn.active {
    background: #16213e;
    color: #4dabf7;
    border-bottom-color: #4dabf7;
}

body.dark-mode .tab-content {
    background: #16213e;
}

body.dark-mode .section-header h2 {
    color: #e0e0e0;
}

body.dark-mode .modal {
    background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .modal-content {
    background: #16213e;
}

body.dark-mode .modal-header {
    border-bottom-color: #0f3460;
}

body.dark-mode .modal-header h3 {
    color: #e0e0e0;
}

body.dark-mode .form-group label {
    color: #e0e0e0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select {
    background: #0f3460;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus {
    background: #16213e;
    border-color: #4dabf7;
}

body.dark-mode .empty-state {
    color: #95a5a6;
}
