/* MILNET-KV Cloud Defense Platform CSS */

/* Variables */
:root {
    --primary-color: #0D47A1;
    --secondary-color: #1976D2;
    --accent-color: #FFC107;
    --background-color: #f0f2f5;
    --text-color: #333;
    --danger-color: #c62828;
    --success-color: #2e7d32;
    --warning-color: #f57f17;
    --info-color: #0288d1;
    --light-color: #f5f5f5;
    --dark-color: #212121;
    
    /* Role-specific colors */
    --admin-color: #1a237e;
    --oficial-color: #0d47a1;
    --analista-color: #0277bd;
}

/* Global Styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    position: relative;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Role-based Color Themes */
.role-admin .navbar {
    background: linear-gradient(45deg, var(--admin-color), #303f9f);
}

.role-oficial .navbar {
    background: linear-gradient(45deg, var(--oficial-color), #1976d2);
}

.role-analista .navbar {
    background: linear-gradient(45deg, var(--analista-color), #0288d1);
}

/* Navigation */
.navbar {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.7rem 1rem;
    transition: all 0.3s;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    overflow: hidden;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    font-weight: 600;
    background-color: #f5f7fa;
    border-bottom: 1px solid #eee;
    padding: 1rem 1.25rem;
}

.card-header.bg-primary {
    background: linear-gradient(45deg, #0D47A1, #1976D2) !important;
    color: white;
}

.card-header.bg-success {
    background: linear-gradient(45deg, #2E7D32, #66BB6A) !important;
    color: white;
}

.card-header.bg-danger {
    background: linear-gradient(45deg, #C62828, #EF5350) !important;
    color: white;
}

.card-header.bg-warning {
    background: linear-gradient(45deg, #EF6C00, #FFA726) !important;
    color: white;
}

.card-icon {
    display: inline-block;
    width: 50px;
    height: 50px;
    font-size: 22px;
    line-height: 50px;
    text-align: center;
    border-radius: 50%;
    margin-right: 15px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Classification Indicators */
.classification-badge {
    padding: 8px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.classification-unclassified {
    background-color: #388e3c;
    color: white;
}

.classification-classified {
    background-color: #f57c00;
    color: white;
}

.classification-secret {
    background-color: #d32f2f;
    color: white;
}

.classification-top_secret {
    background-color: #7b1fa2;
    color: white;
}

/* Classification banner */
.classification-banner {
    background-color: #c62828;
    color: white;
    padding: 10px 15px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Document list styles */
.document-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.document-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.document-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.document-icon {
    font-size: 2rem;
    margin-right: 1.5rem;
    color: #1565C0;
}

.document-info {
    flex: 1;
}

.document-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.document-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.document-classification {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.document-actions {
    display: flex;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    color: #1565C0;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #1565C0;
}

.stat-info p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* Admin stats panel */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.military-header {
    background: linear-gradient(45deg, #0D47A1, #1976D2);
    color: white;
    font-weight: 600;
}

.military-border {
    border: 2px solid #0D47A1;
    border-radius: 4px;
    background-color: rgba(13, 71, 161, 0.05);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.table th {
    font-weight: 600;
    background-color: #f7f9fc;
    border-bottom: 2px solid #e3e6f0;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

/* Action Buttons */
.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin: 0 3px;
}

.btn-action:hover {
    transform: translateY(-2px);
}

/* Forms */
.form-card {
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-label {
    font-weight: 500;
    color: #555;
}

.form-control, .form-select {
    border-radius: 6px;
    padding: 0.6rem 1rem;
    border: 1px solid #ced4da;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 0.2rem rgba(66, 133, 244, 0.25);
}

/* Document Viewer */
.document-viewer {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.document-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
}

.document-content {
    min-height: 300px;
}

/* Custom File Input */
.custom-file-input::-webkit-file-upload-button {
    visibility: hidden;
}

.custom-file-input::before {
    content: 'Select document';
    display: inline-block;
    background: linear-gradient(to bottom, #f9f9f9, #e3e3e3);
    border: 1px solid #999;
    border-radius: 3px;
    padding: 8px 15px;
    outline: none;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
}

.custom-file-input:hover::before {
    background: linear-gradient(to bottom, #e3e3e3, #d3d3d3);
}

/* Footer */
footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: #343a40;
    color: white;
    padding: 15px 0;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 0;
}

/* Media Queries */
@media (max-width: 768px) {
    .stat-card .stat-number {
        font-size: 2rem;
    }
    
    .stat-card .stat-icon {
        font-size: 2.5rem;
    }
}

/* Activity Log */
.activity-log {
    list-style: none;
    padding-left: 0;
    position: relative;
}

.activity-log::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 15px;
    width: 2px;
    background-color: #e9ecef;
}

.activity-item {
    position: relative;
    padding-left: 35px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #e9ecef;
    padding-bottom: 15px;
}

.activity-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #007bff;
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-action {
    font-weight: 500;
    margin-bottom: 5px;
}

.activity-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.activity-log-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #007bff;
}

.activity-log-item:last-child {
    padding-bottom: 0;
}

.activity-log-time {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.activity-log-action {
    margin-bottom: 0;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #1a237e, #0d47a1);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.login-logo {
    max-width: 220px;
    margin-bottom: 15px;
}

.login-form {
    padding: 2rem;
}

.login-footer {
    text-align: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Profile Page */
.profile-header {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.profile-role {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.profile-info {
    margin-bottom: 1.5rem;
}

.profile-bio {
    margin-bottom: 1.5rem;
}

/* Admin Panel */
.admin-card {
    margin-bottom: 2rem;
}

.admin-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Security Classification Watermark */
.watermarked {
    position: relative;
    overflow: hidden;
}

.watermarked::before {
    content: attr(data-watermark);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 5rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    pointer-events: none;
}

/* Session Timer */
#session-timer {
    font-weight: 600;
    color: #ffc107;
}

/* Document Page */
.doc-table td:nth-child(3) {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box .form-control {
    padding-left: 40px;
    border-radius: 20px;
}

.search-box .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

/* Classification Colors */
.classification-tag {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag-unclassified {
    color: #fff;
    background-color: #28a745;
}

.tag-classified {
    color: #fff;
    background-color: #fd7e14;
}

.tag-secret {
    color: #fff;
    background-color: #dc3545;
}

.tag-top_secret {
    color: #fff;
    background-color: #6f42c1;
}

/* Security Risk Indicators */
.risk-indicator {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.risk-indicator .risk-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.risk-indicator .risk-info {
    flex-grow: 1;
}

.risk-indicator .risk-level {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.risk-indicator .risk-description {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.risk-low {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
}

.risk-medium {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
}

.risk-high {
    background-color: rgba(253, 126, 20, 0.1);
    border-left: 4px solid #fd7e14;
}

.risk-critical {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

/* Risk meter */
.risk-meter-container {
    margin-bottom: 1rem;
}

.risk-meter {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
    position: relative;
}

.risk-meter-fill {
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.5s ease;
}

.risk-meter-low {
    background: linear-gradient(90deg, #28a745, #5cb85c);
}

.risk-meter-medium {
    background: linear-gradient(90deg, #ffc107, #ffca28);
}

.risk-meter-high {
    background: linear-gradient(90deg, #fd7e14, #ff9800);
}

.risk-meter-critical {
    background: linear-gradient(90deg, #dc3545, #f44336);
}

.risk-meter-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #6c757d;
}

.risk-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

.risk-badge-low {
    background-color: #28a745;
    color: white;
}

.risk-badge-medium {
    background-color: #ffc107;
    color: #212529;
}

.risk-badge-high {
    background-color: #fd7e14;
    color: white;
}

.risk-badge-critical {
    background-color: #dc3545;
    color: white;
}

/* Security Factors */
.security-factors {
    margin-top: 1.5rem;
}

.security-factor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e9ecef;
}

.security-factor:last-child {
    border-bottom: none;
}

.security-factor-name {
    display: flex;
    align-items: center;
}

.security-factor-icon {
    margin-right: 0.5rem;
    width: 24px;
    height: 24px;
    background-color: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.security-factor-value {
    font-weight: 600;
}

.security-factor-high {
    color: #dc3545;
}

.security-factor-medium {
    color: #fd7e14;
}

.security-factor-low {
    color: #28a745;
}