/**
 * KORUMA Admin Styles
 */

.koruma-admin {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Header */
.koruma-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 12px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.koruma-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.koruma-icon {
    font-size: 40px;
}

.koruma-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

/* Cards */
.koruma-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.koruma-card-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.koruma-card-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.koruma-card-body {
    padding: 30px;
}

/* Status Toggle */
.koruma-status-card {
    border-left: 4px solid #667eea;
}

.koruma-user-lock-card {
    border-left: 4px solid #dc3545;
    background: linear-gradient(to right, #fff5f5 0%, white 10%);
}

.koruma-status-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 20px;
}

.koruma-status-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
    font-weight: 600;
}

.koruma-status-indicator.active {
    color: #28a745;
}

.koruma-status-indicator.inactive {
    color: #dc3545;
}

.status-icon {
    font-size: 32px;
}

.koruma-toggle-btn {
    position: relative;
    width: 120px;
    height: 50px;
    background: #dc3545;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.koruma-toggle-btn.active {
    background: #28a745;
}

.toggle-slider {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.koruma-toggle-btn.active .toggle-slider {
    transform: translateX(70px);
}

.toggle-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.koruma-status-desc {
    color: #6c757d;
    margin: 0;
    line-height: 1.6;
}

/* Stats Grid */
.koruma-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.koruma-stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.koruma-stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.threat {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.week {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon.blocked {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-icon.total {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
}

/* Buttons */
.koruma-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.koruma-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.koruma-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.koruma-btn-secondary {
    background: #6c757d;
    color: white;
}

.koruma-btn-secondary:hover {
    background: #5a6268;
}

.koruma-btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    font-size: 18px;
}

/* Progress */
.koruma-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-animation 2s infinite;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    text-align: center;
    color: #6c757d;
    margin: 0;
}

/* Threats List */
.koruma-threats-list {
    max-height: 600px;
    overflow-y: auto;
}

.koruma-threat-item {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.koruma-threat-item:hover {
    background: #ffe69c;
    transform: translateX(5px);
}

.koruma-threat-item.high {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.koruma-threat-item.high:hover {
    background: #f5c6cb;
}

.threat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.threat-file {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.threat-severity {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.threat-severity.high {
    background: #dc3545;
    color: white;
}

.threat-severity.medium {
    background: #ffc107;
    color: #2c3e50;
}

.threat-info {
    color: #6c757d;
    font-size: 14px;
}

.threat-count {
    background: #dc3545;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Logs Table */
.koruma-logs-container {
    overflow-x: auto;
}

.koruma-logs-table {
    width: 100%;
    border-collapse: collapse;
}

.koruma-logs-table thead {
    background: #f8f9fa;
}

.koruma-logs-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

.koruma-logs-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.koruma-logs-table tbody tr:hover {
    background: #f8f9fa;
}

.log-type {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.log-type-threat_detected {
    background: #f8d7da;
    color: #721c24;
}

.log-type-file_change_detected {
    background: #fff3cd;
    color: #856404;
}

.log-type-protection_toggle {
    background: #d1ecf1;
    color: #0c5460;
}

.no-logs {
    text-align: center;
    color: #6c757d;
    padding: 40px !important;
}

/* Modal */
.koruma-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.koruma-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.koruma-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.koruma-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.koruma-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.koruma-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.koruma-modal-close:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.koruma-modal-body {
    padding: 30px;
}

.threat-detail-code {
    background: #2c3e50;
    color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    overflow-x: auto;
    margin-top: 15px;
}

.code-line {
    padding: 5px 0;
    border-left: 3px solid transparent;
    padding-left: 15px;
}

.code-line.highlight {
    background: #dc3545;
    border-left-color: #ffc107;
    color: white;
}

.code-line-number {
    color: #6c757d;
    margin-right: 15px;
    display: inline-block;
    width: 50px;
}

/* Responsive */
@media (max-width: 768px) {
    .koruma-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .koruma-status-toggle {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .koruma-card-body {
        padding: 20px;
    }
    
    .koruma-logs-table {
        font-size: 14px;
    }
    
    .koruma-logs-table th,
    .koruma-logs-table td {
        padding: 10px;
    }
}

