/* L33 EAPIS Generator - Admin Panel Styles */

/* Admin Panel Layout */
.admin-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Back Link in Header */
.back-link {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    font-size: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 5px;
    background: var(--card-bg);
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.tab-btn i {
    font-size: 16px;
}

.alert-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--error);
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

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

.tab-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 22px;
}

.tab-header h2 i {
    color: var(--primary);
}

/* Entity List */
.entity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Entity Card */
.entity-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.entity-info h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    color: var(--text);
}

.entity-info h3 i {
    color: var(--primary);
}

.entity-actions {
    display: flex;
    gap: 8px;
}

/* Document Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.documents-grid.three-col {
    grid-template-columns: repeat(3, 1fr);
}

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

.documents-grid.two-col {
    grid-template-columns: repeat(2, 1fr);
}

/* Tab Description */
.tab-description {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

/* Document Card */
.document-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
}

.document-card.has-doc {
    border-color: var(--success);
    background: rgba(40, 167, 69, 0.03);
}

.document-card.has-doc.status-expired {
    border-color: var(--error);
    background: rgba(220, 53, 69, 0.05);
}

.document-card.has-doc.status-critical {
    border-color: var(--error);
    background: rgba(220, 53, 69, 0.03);
}

.document-card.has-doc.status-warning {
    border-color: var(--accent);
    background: rgba(241, 131, 0, 0.03);
}

.document-card.has-doc.status-notice {
    border-color: var(--primary-light);
    background: rgba(0, 122, 226, 0.03);
}

.document-card.no-doc {
    border-style: dashed;
}

.doc-icon {
    font-size: 24px;
    color: var(--primary-light);
}

.document-card.has-doc .doc-icon {
    color: var(--success);
}

.document-card.status-expired .doc-icon,
.document-card.status-critical .doc-icon {
    color: var(--error);
}

.document-card.status-warning .doc-icon {
    color: var(--accent);
}

.doc-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.doc-info small {
    font-size: 12px;
    color: var(--text-light);
}

.doc-status {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.doc-status.valid {
    color: var(--success);
}

.doc-status.missing {
    color: var(--text-light);
}

.doc-status.expired {
    color: var(--error);
    font-weight: 600;
}

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

.doc-status.warning {
    color: var(--accent);
}

.doc-status.notice {
    color: var(--primary-light);
}

.doc-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Buttons */
.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: white;
    color: var(--text-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.btn-icon:hover {
    background: var(--bg);
    color: var(--text);
}

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.empty-state i {
    font-size: 60px;
    color: var(--border);
    margin-bottom: 20px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 16px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading i {
    font-size: 24px;
    margin-right: 10px;
}

/* Alert Filters */
.alert-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* Alert Cards */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--border);
}

.alert-card.alert-expired {
    border-left-color: var(--error);
    background: rgba(220, 53, 69, 0.03);
}

.alert-card.alert-critical {
    border-left-color: var(--error);
}

.alert-card.alert-warning {
    border-left-color: var(--accent);
}

.alert-card.alert-notice {
    border-left-color: var(--primary-light);
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.alert-expired .alert-icon {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error);
}

.alert-critical .alert-icon {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error);
}

.alert-warning .alert-icon {
    background: rgba(241, 131, 0, 0.1);
    color: var(--accent);
}

.alert-notice .alert-icon {
    background: rgba(0, 122, 226, 0.1);
    color: var(--primary-light);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-title i {
    color: var(--primary);
    font-size: 14px;
}

.alert-detail {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
}

.alert-status {
    font-weight: 500;
}

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

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

.alert-warning .alert-status {
    color: var(--accent);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-small {
    max-width: 400px;
}

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

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    color: var(--text);
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg);
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--error);
    color: white;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    color: var(--text);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* Form Styles */
#addCrewForm,
#addAircraftForm,
#uploadDocForm {
    padding: 20px;
}

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

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

.form-group label .required {
    color: var(--error);
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(35, 69, 153, 0.1);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

/* File Upload Zone */
.file-upload-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-upload-zone:hover {
    border-color: var(--primary);
    background: rgba(35, 69, 153, 0.03);
}

.file-upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(35, 69, 153, 0.08);
}

.file-upload-zone i {
    font-size: 36px;
    color: var(--primary);
}

.file-upload-zone span {
    font-weight: 500;
    color: var(--text);
}

.file-upload-zone small {
    font-size: 12px;
    color: var(--text-light);
}

.file-upload-zone input[type="file"] {
    display: none;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.selected-file i {
    font-size: 20px;
    color: var(--primary);
}

.selected-file span {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    word-break: break-all;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .admin-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 calc(33% - 5px);
        padding: 12px 10px;
        font-size: 13px;
    }

    .tab-btn i {
        font-size: 14px;
    }

    .tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .tab-header h2 {
        font-size: 18px;
    }

    .documents-grid,
    .documents-grid.four-col {
        grid-template-columns: 1fr;
    }

    .entity-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .alert-card {
        flex-wrap: wrap;
    }

    .alert-detail {
        flex-direction: column;
        gap: 4px;
    }

    .alert-filters {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .admin-container {
        padding: 10px;
    }

    .entity-card {
        padding: 15px;
    }

    .document-card {
        padding: 12px;
    }

    .modal-content {
        margin: 10px;
    }

    #addCrewForm,
    #addAircraftForm,
    #uploadDocForm {
        padding: 15px;
    }
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.test-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 25px;
}

.toggle-label {
    color: white;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #f18300;
}

input:checked + .slider:before {
    transform: translateX(24px);
}
