/* DEFINIÇÃO DE VARIÁVEIS E TEMAS */
:root[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-card: rgba(21, 30, 46, 0.88);
    --bg-input: rgba(11, 17, 32, 0.8);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(56, 189, 248, 0.2);
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

:root[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-input: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(2, 132, 199, 0.3);
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
    background-color: var(--bg-main);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body.view-login {
    background-image: linear-gradient(rgba(11, 15, 25, 0.72), rgba(11, 15, 25, 0.85)), url("Fundo01.jpg");
}

body.view-dashboard {
    background-image: linear-gradient(rgba(11, 15, 25, 0.78), rgba(11, 15, 25, 0.88)), url("Fundo02.jpg");
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.5rem;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
    text-decoration: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
}

.btn-danger-sm {
    background-color: var(--danger);
    color: #ffffff;
    border: none;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.sub-nav {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 1.5rem;
    overflow-x: auto;
}

.sub-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link-btn {
    background: rgba(56, 189, 248, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.nav-link-btn:hover {
    color: var(--text-main);
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--primary);
}

.nav-link-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}

.main-container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

h2 {
    font-size: 1.35rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

#login-view {
    max-width: 440px;
    margin: 2.5rem auto;
    border-top: 3px solid var(--primary);
}

.form-group {
    margin-bottom: 1.1rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

input, textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
}

.password-meter-container {
    height: 4px;
    width: 100%;
    background-color: var(--border-color);
    border-radius: 2px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.meter-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s, background-color 0.3s;
}

.meter-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.institution-footer {
    margin-top: 1.75rem;
    padding: 0.9rem 1.1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.institution-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.institution-text {
    display: flex;
    flex-direction: column;
}

.inst-acronym {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.inst-fullname {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
}

button, .btn-secondary {
    cursor: pointer;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

button:hover, .btn-secondary:hover {
    opacity: 0.9;
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.btn-secondary {
    background-color: rgba(56, 189, 248, 0.15);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.alert {
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

.dash-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.session-timer-box {
    text-align: right;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.timer-digits {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
}

.services-status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    align-items: center;
    justify-content: space-between;
}

.srv-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.hardware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hw-card {
    padding: 1.25rem;
}

.hw-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.progress-track {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--primary);
    border-radius: 5px;
    transition: width 0.5s ease-in-out, background-color 0.3s;
}

.hw-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 8px;
    text-align: center;
}

.metric-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
}

.hash-output-container {
    margin-top: 0.75rem;
}

.hash-output-container textarea,
.hash-output-container input {
    margin-top: 0.25rem;
    font-family: monospace;
    font-size: 0.8rem;
}

.password-gen-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.password-gen-control input[type="range"] {
    width: 50%;
}

.logs-card {
    margin-top: 1rem;
}

.table-responsive {
    overflow-x: auto;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.logs-table th, .logs-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.logs-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.gallery-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.25);
}

.gallery-thumb-container {
    width: 100%;
    height: 180px;
    background-color: #060911;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.gallery-thumb-container::after {
    content: "🔍 Expandir";
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(11, 15, 25, 0.8);
    color: #38bdf8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-thumb-container::after {
    opacity: 1;
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-caption {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gallery-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.gallery-tag {
    font-size: 0.72rem;
    font-family: monospace;
    color: var(--primary);
}

/* ==========================================================================
   MODAL / LIGHTBOX DE IMAGEM EM TELA CHEIA
   ========================================================================== */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 13, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    width: 92vw;
    max-width: 1400px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    background: #0b0f19;
}

.lightbox-caption {
    margin-top: 0.75rem;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: #ffffff;
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.lightbox-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    transform: scale(1.1);
}

/* Área de Vídeo */
.video-wrapper {
    max-width: 900px;
    margin: 1.5rem auto 0;
    background: #000000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.video-player {
    width: 100%;
    max-height: 520px;
    display: block;
    outline: none;
}

.video-info-box {
    margin-top: 1rem;
    background: rgba(15, 23, 42, 0.5);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-info { background: rgba(2, 132, 199, 0.2); color: #38bdf8; }
.badge-warn { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-success { background: rgba(34, 197, 94, 0.2); color: #4ade80; }

.hidden {
    display: none !important;
}
