/* Role Management Modal Styles */
/* Bu CSS sadece role-management modalları için kullanılır */

/* Role Modal Overlay */
.role-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85) !important;
    z-index: 10001 !important; /* Global modallardan 1 fazla */
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(6px);
}

.role-modal-overlay.show {
    display: flex !important;
    animation: roleModalFadeIn 0.3s ease-out;
}

.role-modal-overlay.visible {
    opacity: 1;
}

/* Role Modal Container - Standardized Sizing */
.role-modal {
    background: #1e2228;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    min-width: 600px;
    max-height: 85vh;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0 auto !important;
    border: 1px solid #444;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    animation: roleModalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    transform: scale(0.98);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.role-modal-overlay.visible .role-modal {
    transform: scale(1);
}

/* Role Modal Header - Standardized */
.role-modal-header {
    padding: 28px 32px;
    border-bottom: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #2a2d38 0%, #23272f 100%);
    flex-shrink: 0;
    min-height: 80px;
    box-sizing: border-box;
}

.role-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.role-modal-close:hover {
    background: #333;
    color: #fff;
    transform: scale(1.1);
}

/* Role Modal Body - Consistent Spacing */
.role-modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    color: #fff;
    background: #1e2228;
    box-sizing: border-box;
    min-height: 200px;
}

.role-modal-body::-webkit-scrollbar {
    width: 8px;
}

.role-modal-body::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

.role-modal-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.role-modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Role Modal Footer - Balanced Layout */
.role-modal-footer {
    padding: 24px 32px;
    border-top: 2px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #23272f 0%, #1e2228 100%);
    flex-shrink: 0;
    min-height: 80px;
    box-sizing: border-box;
}

/* Role Modal Buttons - Standardized Sizing */
.role-modal .btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    min-height: 50px;
    box-sizing: border-box;
}

.role-modal .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.role-modal .btn:hover::before {
    left: 100%;
}

.role-modal .btn-primary {
    background: linear-gradient(135deg, #5865f2, #4752c4);
    color: #fff;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.role-modal .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4752c4, #3b429f);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
}

.role-modal .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.role-modal .btn-danger {
    background: linear-gradient(135deg, #f04747, #d73c3c);
    color: #fff;
    box-shadow: 0 4px 15px rgba(240, 71, 71, 0.3);
}

.role-modal .btn-danger:hover {
    background: linear-gradient(135deg, #d73c3c, #be3030);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 71, 71, 0.4);
}

.role-modal .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Form Elements in Role Modal - Standardized */
.role-modal input,
.role-modal textarea,
.role-modal select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
    min-height: 48px;
}

.role-modal input:focus,
.role-modal textarea:focus,
.role-modal select:focus {
    border-color: #5865f2;
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}

.role-modal input::placeholder,
.role-modal textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.role-modal label {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.role-modal .form-group {
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
}

.role-modal .form-group:last-child {
    margin-bottom: 0;
}

/* Select dropdown styling */
.role-modal select option {
    background: #2c2c2c;
    color: #fff;
    padding: 8px 12px;
    border: none;
}

.role-modal select option:hover,
.role-modal select option:focus,
.role-modal select option:checked {
    background: #5865f2;
    color: #fff;
}

/* Permission Groups Styling - Improved Symmetry */
.role-modal .permission-groups {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 8px;
}

.role-modal .permission-group {
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.role-modal .permission-group:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(88, 101, 242, 0.3);
}

.role-modal .permission-group h4 {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.role-modal .group-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
}

.role-modal .permission-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
    padding: 0;
    justify-items: stretch;
}

.role-modal .permission-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 400;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(255, 255, 255, 0.03);
    min-height: 44px;
    box-sizing: border-box;
}

.role-modal .permission-checkbox:hover {
    background: rgba(88, 101, 242, 0.12);
    border-color: rgba(88, 101, 242, 0.3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.15);
}

.role-modal .permission-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

/* Alert Styles for Role Modal */
.role-modal .alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
}

.role-modal .alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #81c784;
}

.role-modal .alert-error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ef5350;
}

.role-modal .alert-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ffb74d;
}

/* Confirm Dialog Styling */
.role-modal .confirm-dialog {
    text-align: center;
    padding: 20px;
}

.role-modal .confirm-dialog i {
    display: block;
    margin-bottom: 16px;
}

.role-modal .confirm-dialog p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    margin: 0;
}

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

@keyframes roleModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(0.95);
    }
}

/* Mobile Responsive - Improved Symmetry */
@media (max-width: 768px) {
    .role-modal {
        width: 95vw;
        min-width: 320px;
        max-width: none;
        max-height: 92vh;
        margin: 0 !important;
        border-radius: 12px;
    }
    
    .role-modal-header {
        padding: 24px;
        min-height: 70px;
    }
    
    .role-modal-body {
        padding: 24px;
    }
    
    .role-modal-footer {
        padding: 24px;
        flex-direction: column;
        gap: 12px;
        min-height: 70px;
    }
    
    .role-modal .btn {
        justify-content: center;
        width: 100%;
        min-height: 52px;
    }
    
    .role-modal .permission-checkboxes {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 16px;
    }
    
    .role-modal .permission-group {
        padding: 20px;
        border-radius: 12px;
    }
    
    .role-modal .form-group {
        margin-bottom: 24px;
    }
}

/* Ensure role modals take precedence over global modals */
#role-modal-overlay {
    z-index: 10001 !important;
}

/* Hide global modal when role modal is active */
.role-modal-overlay.show ~ #modal-overlay {
    display: none !important;
}
