/* YedekUs Cloud Theme - Matching License Server Design */
:root {
    --sidebar-width: 250px;
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --success-color: #22c55e;
    --warning-color: #eab308;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f1f5f9;
}

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Sidebar - License Server Style */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    padding-top: 0;
    z-index: 1000;
}

.sidebar .logo, .sidebar-brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
    background: transparent;
}

.sidebar .logo h4, .sidebar-brand h4, .sidebar-brand {
    color: white;
    margin: 0;
    font-weight: 600;
}

.sidebar .logo small, .sidebar-brand small {
    color: rgba(255,255,255,0.5);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 25px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
    border-left: 3px solid var(--primary-color);
}

.sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
    border-left: 3px solid var(--primary-color);
}

.sidebar .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar .nav-link .badge {
    margin-left: auto;
}

/* Main Content - Full width like License Server */
.main-content {
    padding: 20px;
    min-height: 100vh;
    background-color: var(--bg-light);
    width: 100%;
}

/* Top Bar - License Server Style */
.top-bar {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.top-bar h4 {
    margin: 0;
    color: var(--text-dark);
    font-weight: 600;
}

/* Stat Cards - License Server Style (White with icon) */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    border: 1px solid #e2e8f0;
    min-width: 0;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.stat-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-card .icon.primary { 
    background: rgba(37, 99, 235, 0.1); 
    color: #2563eb; 
}

.stat-card .icon.success { 
    background: rgba(34, 197, 94, 0.1); 
    color: #22c55e; 
}

.stat-card .icon.warning { 
    background: rgba(234, 179, 8, 0.1); 
    color: #eab308; 
}

.stat-card .icon.danger { 
    background: rgba(239, 68, 68, 0.1); 
    color: #ef4444; 
}

.stat-card .icon.info { 
    background: rgba(59, 130, 246, 0.1); 
    color: #3b82f6; 
}

.stat-card .value, .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.stat-card .label, .stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cards - License Server Style */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    background: white;
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    font-weight: 600;
    border-radius: 15px 15px 0 0 !important;
    color: var(--text-dark);
}

.card-body {
    padding: 20px;
}

/* Tables - License Server Style */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    border-top: none;
    vertical-align: middle;
    padding: 12px 15px;
    background: transparent;
}

.table td {
    vertical-align: middle;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.02);
}

/* Row states with left border */
.row-online, .row-success {
    border-left: 4px solid var(--success-color);
}

.row-warning {
    background-color: #fef3c7 !important;
    border-left: 4px solid var(--warning-color);
}

.row-danger {
    background-color: #fee2e2 !important;
    border-left: 4px solid var(--danger-color);
}

.row-offline {
    border-left: 4px solid var(--text-muted);
}

/* Badges - License Server Style */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8rem;
}

.badge-license {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.badge-online, .badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-offline {
    background: #f1f5f9;
    color: #64748b;
}

.badge-running, .badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger, .badge-failed {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-action {
    padding: 5px 10px;
    border-radius: 6px;
}

/* Forms */
.form-control {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    color: var(--primary-color);
    font-weight: bold;
    margin: 0;
    font-size: 1.8rem;
}

.login-logo p {
    color: var(--text-muted);
    margin: 8px 0 0;
}

/* Modal - License Server Style */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 20px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 15px 25px;
}

/* Agent/Data Cards */
.agent-card, .data-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s;
    overflow: hidden;
}

.agent-card:hover, .data-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.agent-card.online {
    border-left-color: var(--success-color);
}

.agent-card.offline {
    border-left-color: var(--text-muted);
}

/* Status indicators */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-dot.online {
    background: var(--success-color);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.offline {
    background: var(--text-muted);
}

/* Days remaining badges */
.days-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.days-danger {
    background: #fee2e2;
    color: #991b1b;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
}

.progress-bar {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
}

.alert-info {
    background-color: #e0f2fe;
    color: #075985;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
    border-radius: 6px;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Empty State */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-color);
}

.invalid {
    outline: 1px solid var(--danger-color);
}

.validation-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Error Boundary */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "Bir hata oluştu.";
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    .sidebar .nav-link span {
        display: none;
    }
    .sidebar .logo h4, .sidebar .logo small {
        display: none;
    }
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }

/* ========================================
   AGENT CARDS - Professional Design
   ======================================== */

.empty-state-card {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.empty-state-card .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state-card h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.agent-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.agent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.agent-card .agent-status-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.agent-card.agent-online .agent-status-indicator {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.agent-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

.agent-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.agent-card.agent-online .agent-icon {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.agent-title {
    flex: 1;
    min-width: 0;
}

.agent-title h5 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-machine {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.agent-badge {
    flex-shrink: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.online {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

.status-badge.offline .status-dot {
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.agent-body {
    padding: 20px;
}

.agent-info-row {
    margin-bottom: 15px;
}

.agent-info-row .info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.token-display {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 10px 12px;
    gap: 10px;
}

.token-display code {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-dark);
    background: transparent;
    word-break: break-all;
}

.token-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
}

.agent-stats {
    display: flex;
    gap: 15px;
    background: var(--bg-light);
    border-radius: 10px;
    padding: 15px;
}

.agent-stats .stat-item {
    flex: 1;
    text-align: center;
}

.agent-stats .stat-icon {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.agent-stats .stat-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.agent-stats .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.agent-offline-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 10px;
    padding: 15px;
    color: #b91c1c;
}

.agent-offline-message span {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.agent-offline-message p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.agent-footer {
    display: flex;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    gap: 10px;
    background: #fafafa;
}

.btn-agent-action {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-agent-action.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-agent-action.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-agent-action.primary:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.btn-agent-action.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    flex: 0;
    padding: 10px 12px;
}

.btn-agent-action.danger:hover {
    background: #dc2626;
    color: white;
}
