/* Training Matrix Styles - Fluent UI inspired */

:root {
    --primary-color: #0078d4;
    --primary-hover: #106ebe;
    --primary-light: #eff6fc;
    --secondary-color: #ff7900;
    --secondary-hover: #e65900;
    --neutral-light: #f3f2f1;
    --neutral-lighter: #faf9f8;
    --neutral-dark: #323130;
    --neutral-secondary: #605e5c;
    --success-color: #107c10;
    --warning-color: #ffb900;
    --error-color: #d13438;
    --border-color: #e1dfdd;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

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

body {
    font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--neutral-dark);
    background: var(--neutral-lighter);
    min-height: 100vh;
}

/* Main Container */
.training-matrix {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--neutral-dark);
}

.fullscreen-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--neutral-secondary);
    transition: background 0.2s;
}

.fullscreen-button:hover {
    background: var(--neutral-light);
}

.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--white);
    max-width: none !important;
    margin: 0 !important;
    padding: 20px;
    overflow: auto;
}

/* Description */
.description {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    color: var(--neutral-dark);
}

/* Welcome/Deployment Section */
.welcome, .deployment-section {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.deployment-section h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--neutral-dark);
}

.deployment-section h4 {
    font-size: 16px;
    margin: 20px 0 10px;
    color: var(--neutral-dark);
}

.deployment-section p {
    margin-bottom: 12px;
    color: var(--neutral-secondary);
}

.deployment-section ul, .deployment-section ol {
    margin-left: 24px;
    margin-bottom: 16px;
    color: var(--neutral-secondary);
}

.deployment-section li {
    margin-bottom: 8px;
}

.list-info {
    list-style: none;
    margin-left: 0 !important;
}

.list-info li {
    padding: 8px 12px;
    background: var(--neutral-light);
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
}

.deployment-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.view-buttons {
    text-align: center;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    height: 8px;
    background: var(--neutral-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
    width: 0%;
}

.progress-container p {
    margin-top: 8px;
    font-size: 12px;
    color: var(--neutral-secondary);
}

.deployment-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--success-color);
    color: white;
}

.deployment-message:not(.success) {
    background: var(--error-color);
}

/* Buttons */
.primary-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-button:hover:not(:disabled) {
    background: var(--primary-hover);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn {
    background: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-light);
}

.toggle-btn {
    background: var(--white);
    color: var(--neutral-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    margin-right: 4px;
}

.toggle-btn.active, .toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Pivot/Tabs */
.pivot {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
    overflow-x: auto;
}

.pivot-item {
    flex: 0 0 auto;
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--neutral-secondary);
    transition: all 0.2s;
}

.pivot-item:hover {
    background: var(--neutral-light);
}

.pivot-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab Content */
.tab-content {
    background: var(--white);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    min-height: 500px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grid View (Card Layout) */
.grid-view {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.card {
    width: 320px;
    min-width: 280px;
    max-width: 380px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--secondary-color);
    color: white;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
}

.card-content {
    padding: 16px;
}

.card-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.card-label {
    color: var(--neutral-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.card-value {
    color: var(--neutral-dark);
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-description {
    margin-top: 12px;
    color: var(--neutral-secondary);
    font-size: 13px;
    font-style: italic;
}

/* Persona Card (for employees) */
.persona-card .card-header {
    text-align: center;
    padding-bottom: 16px;
}

.persona-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.persona-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.persona-name {
    font-weight: 600;
    color: white;
}

.persona-job {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
}

/* Table/List View */
.table-container {
    overflow: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--primary-hover);
}

th:first-child {
    border-top-left-radius: var(--radius-md);
}

th:last-child {
    border-top-right-radius: var(--radius-md);
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

tr:hover td {
    background: var(--neutral-light);
}

/* Filter Header (with filter inputs) */
.filter-header {
    display: grid;
    background: var(--neutral-light);
    border-bottom: 1px solid var(--border-color);
}

.filter-cell {
    padding: 10px 12px;
    border-right: 1px solid white;
}

.filter-cell:last-child {
    border-right: none;
}

.filter-cell input[type="text"],
.filter-cell input[type="date"],
.filter-cell select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--white);
}

.filter-cell input:focus,
.filter-cell select:focus {
    outline: 2px solid var(--primary-color);
    border-color: var(--primary-color);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--neutral-light);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--neutral-secondary);
}

.filter-group input,
.filter-group select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    min-width: 150px;
}

/* Status Colors */
.status-current { background: #dff6dd; }
.status-expiring { background: #fff4ce; }
.status-expired { background: #ffe0b2; }

/* Matrix Grid View */
.matrix-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.matrix-job-group {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.matrix-job-header {
    background: var(--neutral-light);
    padding: 10px 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.matrix-courses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
}

.matrix-course-card {
    background: var(--secondary-color);
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.matrix-course-card:hover {
    transform: scale(1.02);
}

/* Matrix List (Table) */
.matrix-table-container {
    overflow: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

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

.matrix-table th {
    background: var(--secondary-color);
    color: white;
    padding: 12px;
    text-align: center;
    white-space: nowrap;
}

.matrix-table th:first-child {
    background: var(--primary-color);
    position: sticky;
    left: 0;
    z-index: 2;
}

.matrix-table td {
    padding: 10px 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.matrix-table td:first-child {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 1;
}

.matrix-table tr:hover td {
    background: #f8f8f8;
}

.matrix-table tr:hover td:first-child {
    background: #005a9e;
}

.matrix-check {
    color: var(--success-color);
    font-weight: bold;
}

/* Records Grid View */
.record-card {
    width: 300px;
}

.record-status {
    font-weight: 600;
}

.record-status.current { color: var(--success-color); }
.record-status.expiring { color: var(--warning-color); }
.record-status.expired { color: var(--error-color); }

/* Admin Panel */
.edit-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 350px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--neutral-light);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--neutral-secondary);
    padding: 0;
    line-height: 1;
}

.panel-content {
    padding: 20px;
}

.form-section {
    display: none;
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--neutral-lighter);
}

.form-section.active {
    display: block;
}

.form-section h4 {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

.form-section form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-section input,
.form-section select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.form-section form button {
    margin-top: 8px;
}

.edit-forms {
    margin-top: 20px;
}

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

.modal-content {
    background: var(--white);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--neutral-light);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

.modal-body form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-body .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-body label {
    font-weight: 600;
    font-size: 13px;
    color: var(--neutral-secondary);
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    outline: 2px solid var(--primary-color);
    border-color: var(--primary-color);
}

.modal-body .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: var(--neutral-dark);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success-color); }
.toast.error { background: var(--error-color); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        justify-content: center;
        flex-wrap: wrap;
    }

    .card {
        width: 100%;
    }

    .pivot {
        justify-content: flex-start;
    }

    .edit-panel {
        width: 100%;
    }
}

/* Color utility classes */
.bg-primary { background: var(--primary-color); color: white; }
.bg-secondary { background: var(--secondary-color); color: white; }
.bg-success { background: var(--success-color); color: white; }
.bg-warning { background: var(--warning-color); color: var(--neutral-dark); }
.bg-error { background: var(--error-color); color: white; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }
.text-muted { color: var(--neutral-secondary); }
