/* DiyoVM API Gateway Admin Panel CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #f8fafc;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: white;
    box-shadow: var(--shadow);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
}

.header h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Navigation */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.nav-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    text-decoration: none;
}

.nav-tab:hover {
    background-color: var(--secondary-color);
    color: var(--text-primary);
}

.nav-tab.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h2 .icon {
    font-size: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Form Sections */
.form-section {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.form-section h3 {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.form-section h4 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    margin: 16px 0 12px 0;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

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

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--secondary-color);
    font-weight: 600;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background-color: var(--secondary-color);
}

/* Badge */
.badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Grid */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Status indicators */
.status-online {
    color: var(--success-color);
}

.status-offline {
    color: var(--error-color);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Code blocks */
.code {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    overflow-x: auto;
}

/* Input with button (for CID/CToken generation) */
.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
}

.btn-generate {
    min-width: 40px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-generate:hover {
    background-color: #4f46e5;
    color: white;
    transform: scale(1.05);
}

/* Applications Multi-Select */
.applications-multiselect {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    background-color: #f8fafc;
}

.application-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin: 4px 0;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    transition: all 0.2s;
}

.application-item:hover {
    background-color: #f1f5f9;
    border-color: var(--primary-color);
}

.application-item input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.application-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.application-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 4px;
}

.application-details {
    flex: 1;
}

.application-name {
    font-weight: 600;
    color: var(--text-primary);
}

.application-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.application-version {
    font-size: 11px;
    background-color: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* License Applications Display */
.applications-list {
    margin-top: 12px;
}

.license-app-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 6px 0;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s;
}

.license-app-item:hover {
    background-color: #f1f5f9;
    border-color: var(--primary-color);
}

.license-app-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 3px;
}

.license-app-details {
    flex: 1;
}

.license-app-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.license-app-version {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.license-app-status {
    font-size: 12px;
    font-weight: 600;
    color: #22c55e;
}

/* Application List Display */
.app-info {
    display: flex;
    align-items: center;
}

.app-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .nav-tabs {
        flex-direction: column;
    }

    .nav-tab {
        text-align: center;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 16px;
    }
}

/* System Details Styles */
.system-details-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .system-details-container {
        grid-template-columns: 1fr;
    }
}

.detail-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.detail-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-icon {
    font-size: 24px;
    line-height: 1;
}

.detail-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.detail-content {
    padding: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.code-text {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-secondary {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-info {
    background: #0dcaf0;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-error {
    background: var(--error-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* File Status Styles */
.files-grid {
    display: grid;
    gap: 12px;
}

.file-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-icon {
    font-size: 18px;
    line-height: 1;
}

/* Stats Styles */
.stats-grid {
    display: grid;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    font-size: 18px;
    line-height: 1;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Status Styles */
.status-grid {
    display: grid;
    gap: 12px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.status-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-icon {
    font-size: 18px;
    line-height: 1;
}

.status-value {
    font-weight: 600;
    color: var(--text-primary);
}

.status-value.online {
    color: var(--success-color);
    font-weight: 700;
}

/* Dashboard Styles */
.dashboard-card {
    text-align: center;
    padding: 32px 24px;
}

.dashboard-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}

.dashboard-card h2 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.dashboard-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.4;
}

.dashboard-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.metric-number {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.metric-number.build-number {
    font-size: 28px;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Announcement Type Display */
.type-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.type-icon {
    font-size: 24px;
    line-height: 1;
}

.type-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    margin: 20px;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-content h4 {
    color: var(--text-primary);
    margin: 16px 0 8px 0;
}

.license-modal strong {
    color: var(--text-primary);
    display: inline-block;
    min-width: 120px;
}

.license-modal ul {
    background-color: var(--secondary-color);
    border-radius: 8px;
    padding: 12px 20px;
    margin: 8px 0;
}

.license-modal li {
    margin-bottom: 4px;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 8px !important;
}

.mb-2 {
    margin-bottom: 16px !important;
}

.mb-3 {
    margin-bottom: 24px !important;
}

.mt-2 {
    margin-top: 16px !important;
}

.mt-3 {
    margin-top: 24px !important;
}

.font-weight-bold {
    font-weight: 600;
}

.text-sm {
    font-size: 14px;
}

.text-xs {
    font-size: 12px;
}