/* Permissions Page Styles */

/* Permissions Content Container */
.permissions-content {
    padding: 2rem;
    
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.page-title-section {
    flex: 1;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: #22c55e;
}

.section-subtitle {
    color: #718096;
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #22c55e 0%, #eab308 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.btn-edit {
    background: #4299e1;
    color: white;
    margin-right: 0.5rem;
}

.btn-edit:hover {
    background: #3182ce;
    transform: scale(1.1);
}

.btn-delete {
    background: #e53e3e;
    color: white;
}

.btn-delete:hover {
    background: #c53030;
    transform: scale(1.1);
}

/* Table Container */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* DataTables Customization */
.dataTables_wrapper {
    padding: 1.5rem;
}

.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_filter input {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.dataTables_length select {
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.dataTables_info {
    color: #718096;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.dataTables_paginate {
    margin-top: 1rem;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dataTables_paginate .paginate_button:hover {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

.dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #22c55e 0%, #eab308 100%);
    color: white;
    border-color: #22c55e;
}

/* Table Styles */
#permissionsTable {
    width: 100%;
    border-collapse: collapse;
}

#permissionsTable thead th {
    background: rgba(34, 197, 94, 0.1);
    color: #2d3748;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

#permissionsTable tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

#permissionsTable tbody tr:hover {
    background: rgba(34, 197, 94, 0.05);
}

/* Category Badge Styles */
.category-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
}

.category-badge.user_management {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.category-badge.directorate_management {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-badge.role_management {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.category-badge.permission_management {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.category-badge.system_management {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.category-badge.project_management {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.category-badge.report_management {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.category-badge.document_management {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Status Badge */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(56, 161, 105, 0.1);
    color: #38a169;
    border: 1px solid rgba(56, 161, 105, 0.3);
}

.status-badge.inactive {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
    border: 1px solid rgba(229, 62, 62, 0.3);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-title i {
    color: #22c55e;
}

.modal-close {
    background: none;
    border: none;
    color: #718096;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.modal-body {
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-group label {
    /* display: block; */
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a0aec0;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox Styles */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    width: 100%;
    min-width: 0;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #2d3748;
    font-size: 0.9rem;
    width: 100%;
    min-width: 0;
    flex: 1;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    background: white;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-container input[type="checkbox"]:checked + .checkbox-label .checkmark {
    background: linear-gradient(135deg, #22c55e 0%, #eab308 100%);
    border-color: #22c55e;
}

.checkbox-container input[type="checkbox"]:checked + .checkbox-label .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-container input[type="checkbox"]:checked + .checkbox-label {
    color: #22c55e;
}

/* Field Note */
.field-note {
    color: #718096;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(34, 197, 94, 0.05);
    border-radius: 0.5rem;
    border-left: 3px solid #22c55e;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.4;
    width: 100%;
    box-sizing: border-box;
}

.field-note i {
    color: #22c55e;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* Delete Modal Specific */
.delete-item-name {
    font-weight: 600;
    color: #2d3748;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(229, 62, 62, 0.1);
    border-radius: 0.5rem;
    border-left: 4px solid #e53e3e;
}

.delete-warning {
    color: #e53e3e;
    font-size: 0.9rem;
    font-weight: 500;
}

/* DataTables Buttons */
.dt-buttons {
    margin-bottom: 1rem;
}

.dt-button {
    background: linear-gradient(135deg, #22c55e 0%, #eab308 100%) !important;
    color: white !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    margin-right: 0.5rem !important;
    transition: all 0.3s ease !important;
}

.dt-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.3) !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .permissions-content {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .table-container {
        margin-bottom: 1rem;
    }
    
    .dataTables_wrapper {
        padding: 1rem;
    }
    
    .dt-buttons {
        text-align: center;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .dt-button {
        margin-bottom: 0.5rem;
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .permissions-content {
        padding: 0.5rem;
    }
    
    .page-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        width: 100%;
        justify-content: center;
    }
    
    .dataTables_wrapper {
        padding: 0.5rem;
    }
    
    .dataTables_filter input {
        width: 100%;
        max-width: 200px;
    }
    
    .dataTables_length select {
        max-width: 80px;
    }
    
    #permissionsTable thead th,
    #permissionsTable tbody td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .category-badge,
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .dt-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .dt-button {
        width: 100%;
        max-width: 200px;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .permissions-content {
        padding: 0.25rem;
    }
    
    .page-header {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .section-title {
        font-size: 1.2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .section-subtitle {
        font-size: 0.8rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 0.25rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .checkbox-label {
        font-size: 0.85rem;
    }
    
    .field-note {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .dataTables_wrapper {
        padding: 0.25rem;
    }
    
    .dataTables_filter {
        margin-bottom: 0.5rem;
    }
    
    .dataTables_filter input {
        max-width: 150px;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .dataTables_length select {
        max-width: 60px;
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .dataTables_info {
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }
    
    .dataTables_paginate {
        margin-top: 0.5rem;
    }
    
    .dataTables_paginate .paginate_button {
        padding: 0.4rem 0.6rem;
        margin: 0 0.1rem;
        font-size: 0.8rem;
    }
    
    #permissionsTable thead th,
    #permissionsTable tbody td {
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
    }
    
    .category-badge,
    .status-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    .action-buttons {
        gap: 0.2rem;
    }
    
    .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .dt-buttons {
        gap: 0.25rem;
    }
    
    .dt-button {
        max-width: 150px;
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    .delete-item-name {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .delete-warning {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .permissions-content {
        padding: 0.1rem;
    }
    
    .page-header {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .section-subtitle {
        font-size: 0.75rem;
    }
    
    .modal-content {
        width: 99%;
        margin: 0.1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .checkbox-label {
        font-size: 0.8rem;
    }
    
    .field-note {
        font-size: 0.75rem;
        padding: 0.4rem;
    }
    
    .dataTables_wrapper {
        padding: 0.1rem;
    }
    
    .dataTables_filter input {
        max-width: 120px;
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .dataTables_length select {
        max-width: 50px;
        padding: 0.3rem;
        font-size: 0.75rem;
    }
    
    .dataTables_info {
        font-size: 0.75rem;
    }
    
    .dataTables_paginate .paginate_button {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
    }
    
    #permissionsTable thead th,
    #permissionsTable tbody td {
        padding: 0.3rem 0.1rem;
        font-size: 0.7rem;
    }
    
    .category-badge,
    .status-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
    }
    
    .dt-button {
        max-width: 120px;
        padding: 0.3rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
}

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

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

/* Loading States */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4299e1;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
    font-size: 0.9rem;
}

.notification.show {
    transform: translateX(0);
}

.notification.notification-error {
    background: #e53e3e;
}

.notification.notification-success {
    background: #38a169;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.notification-close:hover {
    opacity: 1;
}
